Changes between Version 60 and Version 61 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
- Timestamp:
- Oct 28, 2010, 8:22:02 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
v60 v61 356 356 geometry=OGR_G_CreateGeometryFromJson(tmp->value); 357 357 else 358 geometry=createGeometryFrom GML(conf,tmp->value);359 }}} 360 361 Basicaly, if we get an input with a {{{mimeType}}} set to {{{application/json}}}, then we will use our {{{OGR_G_CreateGeometryFromJson}}} in other case, our {{{createGeometryFrom GML}}} local function.358 geometry=createGeometryFromWFS(conf,tmp->value); 359 }}} 360 361 Basicaly, if we get an input with a {{{mimeType}}} set to {{{application/json}}}, then we will use our {{{OGR_G_CreateGeometryFromJson}}} in other case, our {{{createGeometryFromWFS}}} local function. 362 362 363 363 Please note that in some sense the data inputs are not really of the same kind. Indeed as we used directly {{{OGR_G_CreateGeometryFromJson}}} it means that the JSON string include only the geometry object and not the full GeoJSON string. Nevertheless, you can easily change this code to be able to use a full GeoJSON string, simply by creating a function which will extract the geometry object from the GeoJSON string (using the json-c library for instance, which is also used by the OGR GeoJSON Driver).