1 | .. _ogr_base_vect_ops: |
---|
2 | |
---|
3 | ********************************************************* |
---|
4 | Presenting building blocks - Using OGR based Web Services |
---|
5 | ********************************************************* |
---|
6 | |
---|
7 | .. contents:: Table of Contents |
---|
8 | :depth: 5 |
---|
9 | :backlinks: top |
---|
10 | |
---|
11 | Introduction |
---|
12 | ============ |
---|
13 | |
---|
14 | In this section, you will use basic ZOO-Services : ``BufferPy``, |
---|
15 | ``IntersectionPy`` and ``DifferencePy`` which use OGR Python module. |
---|
16 | The intended goal of this section is to present and interact with your new building blocks before chaining them in the next section. |
---|
17 | |
---|
18 | First of all, you should use the following link to access a user interface to interact with your service : |
---|
19 | `http://localhost/zoows-demo/spatialtools-py.html <http://localhost/zoows-demo/spatialtools-py.html>`__ |
---|
20 | |
---|
21 | Services Provider and configuration files |
---|
22 | ========================================= |
---|
23 | |
---|
24 | First you may verify if the ZOO-Services are available from your current setup. |
---|
25 | You can take a look at the ``Buffer.zcfg``, ``Intersection.zcfg`` and |
---|
26 | ``DifferencePy.zcfg`` to get details about parameters. |
---|
27 | As you can see from the ZCFG files, you will use ZOO-Services provided by the |
---|
28 | ``foss4g_ws`` Python service provider. So if you want to modify the Python code |
---|
29 | you will have to edit this file. |
---|
30 | You are invited to use similar requests as you seen in previous sections to learn about each service. |
---|
31 | |
---|
32 | The Buffer Service |
---|
33 | ========================= |
---|
34 | |
---|
35 | First click on a street then once the street is displayed in blue, click the |
---|
36 | 'Buffer' button on top, you should get similar result as displayed in the following. |
---|
37 | |
---|
38 | .. image:: ./images/Buffer_Level_15.png |
---|
39 | :width: 650px |
---|
40 | :align: center |
---|
41 | |
---|
42 | Since version ZOO-Project 1.2.0, you can run automatically some basic tests to |
---|
43 | make sure that you wrote a correct ZCFG file and your service is validating. |
---|
44 | |
---|
45 | .. note:: the current testing is really simple and should be adapted to each Services |
---|
46 | Provider, mainly to define input names. |
---|
47 | |
---|
48 | You can use the following command: |
---|
49 | |
---|
50 | .. code-block:: bash |
---|
51 | |
---|
52 | cd /home/user/zoo/testing |
---|
53 | ./run.sh http://localhost/cgi-bin/zoo_loader.cgi Buffer |
---|
54 | |
---|
55 | |
---|
56 | .. note:: During or after the test run, you can take a look inside the ``tmp`` directory |
---|
57 | which contains both the XML requests send to the ZOO Kernel (``*1.xml``) and the |
---|
58 | responses it gave (``output*.xml``). |
---|
59 | |
---|
60 | The Intersection Service |
---|
61 | ========================= |
---|
62 | |
---|
63 | Using the same client interface as before, once you get a Buffer, you can then |
---|
64 | select a street intersecting the Buffer geometry to compute intersection by clicking on the Intersection button. |
---|
65 | |
---|
66 | |
---|
67 | .. image:: ./images/Intersection_Level_15.png |
---|
68 | :width: 650px |
---|
69 | :align: center |
---|
70 | |
---|
71 | |
---|
72 | The Difference Service |
---|
73 | ========================= |
---|
74 | |
---|
75 | Using the same instructions as for Intersetion, you can get the following result. |
---|
76 | |
---|
77 | .. image:: ./images/Difference_Level_15.png |
---|
78 | :width: 650px |
---|
79 | :align: center |
---|
80 | |
---|
81 | |
---|
82 | Conclusion |
---|
83 | ======== |
---|
84 | |
---|
85 | Now you know this three services, and you get a simple interface to interact |
---|
86 | with your MapServer WFS and your ZOO-Project WPS Servers, you are ready to use |
---|
87 | the Services in a different way by chaining them using the ZOO-API to build |
---|
88 | more complexe and powerfull services. |
---|