|
Last change
on this file since 259 was
256,
checked in by djay, 15 years ago
|
|
Add the workshop 2010 material as Restructured text. Some issues with table of content and pdf production due to number of sub title level used in the workshop material.
|
|
File size:
2.2 KB
|
| Line | |
|---|
| 1 | .. _exercise: |
|---|
| 2 | |
|---|
| 3 | Exercise |
|---|
| 4 | ####### |
|---|
| 5 | |
|---|
| 6 | You know everything now about writting zcfg matadata files and get short pieces of code in ``service.c`` or ``ogr_service_provider.py`` depending if you choosen C or Python programming language respectively. |
|---|
| 7 | |
|---|
| 8 | The goal of this exercise is to implement the following multiple geometries services : |
|---|
| 9 | |
|---|
| 10 | - Intersection |
|---|
| 11 | - Union |
|---|
| 12 | - Difference |
|---|
| 13 | - SymDifference |
|---|
| 14 | |
|---|
| 15 | C version |
|---|
| 16 | ********** |
|---|
| 17 | |
|---|
| 18 | Your are now invited to edit the source.c file you have created during this workshop to add the multiple geometries, using the following OGR C-API functions : |
|---|
| 19 | |
|---|
| 20 | - `OGR_G_Intersection <http://www.gdal.org/ogr/ogr__api_8h.html#5a271b5c7b72994120e7a6bbc7e7e5cb>`__ (OGRGeometryH, OGRGeometryH) |
|---|
| 21 | - `OGR_G_Union <http://www.gdal.org/ogr/ogr__api_8h.html#5a271b5c7b72994120e7a6bbc7e7e5cb>`__ (OGRGeometryH, OGRGeometryH) |
|---|
| 22 | - `OGR_G_Difference <http://www.gdal.org/ogr/ogr__api_8h.html#497977bec6ecd9dade7a9694f776be64>`__ (OGRGeometryH, OGRGeometryH) |
|---|
| 23 | - `OGR_G_SymmetricDifference <http://www.gdal.org/ogr/ogr__api_8h.html#d6dacf495617a230c6f19950bc415f17>`__ (OGRGeometryH, OGRGeometryH) |
|---|
| 24 | |
|---|
| 25 | You can use the ``Boundary.zcfg`` file as example, rename the InputPolygon input to ``InputEntity1`` and add a similar input named ``IntputEntity2``. You are invited to update other values in the ZOO Metadata File to set the proper metadata informations. |
|---|
| 26 | |
|---|
| 27 | Python Version |
|---|
| 28 | **************** |
|---|
| 29 | |
|---|
| 30 | Your are invited to edit the ``ogr_ws_service_provider.py`` file you created during this workshop to add the multiple geometries using the following ``osgeo.ogr`` Geometry methods applied on the first Geometry instance : |
|---|
| 31 | |
|---|
| 32 | - Intersection(Geometry) |
|---|
| 33 | - Union(Geometry) |
|---|
| 34 | - Difference(Geometry) |
|---|
| 35 | - SymmetricDifference(Geometry) |
|---|
| 36 | |
|---|
| 37 | You can once again use the ``Boundary.zcfg`` file as example, rename the ``InputPolygon`` input to ``InputEntity1`` and add a similar input named ``IntputEntity2``. You are invited to update other values in the ZOO metadata file to set the proper metadata informations. |
|---|
| 38 | |
|---|
| 39 | Testing your services |
|---|
| 40 | *********************** |
|---|
| 41 | |
|---|
| 42 | Once the multiple geometries Services are deployed on your local environment, please reload the ``zoo-ogr.html`` file created during the previous section from your browser and test your brand new ZOO Services. |
|---|
| 43 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.