Changes between Version 39 and Version 40 of ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
- Timestamp:
- Oct 16, 2010, 1:13:31 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ZooWorkshop/FOSS4GJapan/CreatingOGRBasedWebServices
v39 v40 696 696 The genericity of the applyOne function let you add two new Services in your ZOO Services Provider : !ConvexHull and Centroid. 697 697 698 Note that you should define MY_OGR_Centroidfunction before the Centroid one as [http://www.gdal.org/ogr/ogr__api_8h.html#23f5a19a81628af7f9cc59a37378cb2b OGR_G_Centroid] don't return a geometry object but set the value to an already existing one and support only Polygon as input, so to ensure we use the !ConvexHull for MultiPolygon. So please use the code bellow :699 700 {{{ 701 #!c 702 698 Note that you should define {{{MY_OGR_Centroid}}} function before the Centroid one as [http://www.gdal.org/ogr/ogr__api_8h.html#23f5a19a81628af7f9cc59a37378cb2b OGR_G_Centroid] don't return a geometry object but set the value to an already existing one and support only Polygon as input, so to ensure we use the !ConvexHull for MultiPolygon. So please use the code bellow : 699 700 {{{ 701 #!c 702 OGRGeometryH MY_OGR_G_Centroid(OGRGeometryH hTarget){ 703 703 OGRGeometryH res; 704 704 res=OGR_G_CreateGeometryFromJson("{\"type\": \"Point\", \"coordinates\": [0,0] }"); … … 712 712 }}} 713 713 714 To deploy your Services, you only have to copy the Boundary.zcfg metadata file from your cgi-env directory as {{{ConvexHull.zcfg}}} and {{{Centroid.zcfg}}}. Then, you must rename the Service name on the first line to be able to run and test the Executerequest in the same way you did before. You only have to set the Identifier value to !ConvexHull or Centroid in your request depending on the Service you want to run.714 To deploy your Services, you only have to copy the Boundary.zcfg metadata file from your cgi-env directory as {{{ConvexHull.zcfg}}} and {{{Centroid.zcfg}}}. Then, you must rename the Service name on the first line to be able to run and test the {{{Execute}}} request in the same way you did before. You only have to set the Identifier value to !ConvexHull or Centroid in your request depending on the Service you want to run. 715 715 716 716 Note here that the !GetCapabilities and !DescribeProcess requests will return odd results as we didn't modified any metadata informations, you can edit the .zcfg files to set correct values. By the way it can be used for testing purpose, as the input and output get the same name and default/supported formats.