source: trunk/docs/workshop/2013/building_blocks_presentation.txt @ 443

Last change on this file since 443 was 443, checked in by djay, 11 years ago

Add the 2013 FOSS4G workshop material, just one week after the event.

File size: 5.9 KB
Line 
1.. _ogr_base_vect_ops:
2
3*********************************************************
4Building blocks presentation - Using OGR and PgRouting based Web Services
5*********************************************************
6
7.. contents:: Table of Contents
8    :depth: 5
9    :backlinks: top
10
11Introduction
12============
13
14In this section, you will use basic ZOO-Services : ``Buffer``,
15``Intersection`` and ``DifferencePy`` which use OGR and psycopg Python modules.
16The intended goal of this section is to present and interact with your new building blocks before chaining them in the next section.
17
18First of all, you should use the following links to access the user
19interfaces and interact with your services, the first one is used to
20access basic spatial-tools demo client interface and  the second to
21access the routing application :
22  * `http://localhost/zoows2013-demo/spatialtools-py.html <http://localhost/zoows2013-demo/spatialtools-py.html>`__
23  * `http://localhost/zoo-ws2013/ <http://localhost/zoo-ws2013/>`__
24
25Services Provider and configuration files
26=========================================
27
28First you may verify if the ZOO-Services are available from your current setup.
29You can take a look at the ``Buffer.zcfg``, ``Intersection.zcfg`` and
30``DifferencePy.zcfg`` to get details about parameters.
31As you can see from the ZCFG files, you will use ZOO-Services provided by the
32``service`` Python service provider. So if you want to modify the Python code
33you will have to edit the corresponding file (so ``service.py``).
34You are invited to use similar requests as the one used in previous
35sections to learn about each services individually.
36
37The Buffer Service
38=========================
39
40First click on a street then once the street is displayed in blue, click the
41'Buffer' button on top, you should get similar result as displayed in the following.
42
43.. image:: ./images/Buffer_Level_15.png
44   :width: 650px
45   :align: center
46
47Since version ZOO-Project 1.2.0, you can run automatically some basic tests to
48make sure that you wrote a correct ZCFG file and your service is validating.
49
50.. note:: the current testing is really simple and should be adapted to each Services
51    Provider, mainly to define input names.
52
53You can use the following command:
54
55.. code-block:: bash
56   
57    cd /home/user/zoo/testing
58    ./run.sh http://localhost/cgi-bin/zoo_loader.cgi Buffer
59
60
61.. note:: During or after the test run, you can take a look inside the ``tmp`` directory
62    which contains both the XML requests send to the ZOO Kernel (``*1.xml``) and the
63    responses it gave (``output*.xml``).
64
65The Intersection Service
66=========================
67
68Using the same client interface as before, once you get a Buffer, you can then
69select a street intersecting the Buffer geometry to compute intersection by clicking on the Intersection button.
70
71   
72.. image:: ./images/Intersection_Level_15.png
73   :width: 650px
74   :align: center
75
76
77The DifferencePy Service
78=========================
79
80Using the same instructions as for Intersetion, you can get the following result.
81
82.. image:: ./images/Difference_Level_15.png
83   :width: 650px
84   :align: center
85
86
87The Routing and Profile Services
88=========================
89
90First click on the blue flag then place your starting point on the
91map, do the same with the red flag to get the shortest path computed
92by the dedicated service and then display its profile. Note that when
93you pass the mouse over the profile display then you will see its
94corresponding position displayed on the map. You can also click on a
95specific step in your path to get the corresponding line displayed.
96
97.. image:: ./images/Routing_Basic.png
98   :width: 650px
99   :align: center
100
101If you take a look in the file: ``/usr/lib/cgi-bin/routing/do.zcfg``
102you may notice something new in the supported format which is
103reproduced here after.
104 
105.. code-block:: guess
106   
107    <Supported>
108     mimeType = image/png
109     asReference = true
110     msStyle = STYLE COLOR 125 0 105 OUTLINECOLOR 0 0 0 WIDTH 3 END
111     useMapServer = true
112     extension = json
113    </Supported>
114
115The ``mimeType`` is defined as ``image/png`` and there is two new
116parameter which are both optional:
117  * ``useMapServer``: which make you able to inform the ZOO-Kernel
118    that it have to use MapServer to publish your result as WMS / WFS or WCS (this last
119    won't be used in this workshop) rather than simply storing the
120    result as a file.
121  * ``msStyle``: which let you define your own MapServer ``STYLE`` block definition.
122
123When you need to access a result many time or for different purpose
124accross other services then it is really useful to ask ZOO-Kernel to
125publish your result as WMS, WFS or WCS.
126
127Note that no modification of the code of the do service was required
128to handle automatic pubilcation of the result as it is a vector format
129supported by OGR, only modification of the zcfg was required.
130
131This routing example is here to illustrate how easy it is to publish
132your result as WMS, WFS or WCS ressource. Indeed, when your routing
133service was called, ZOO-Kernel published the result as WMS and WFS
134ressources which was both used first for the UI purpose, the WMS to
135display the resulting path on the map, the WFS for displaying details
136about each steps. The WFS protocol is also used as the input value
137for the profile computation. So, the computation was run once
138and accessed three times for different purposes and from different
139clients.
140
141For more informations about the MapServer support, please refer to `the
142official  ZOO-Project Documentation <http://zoo-project.org/docs/kernel/mapserver.html>`_.
143
144Conclusion
145========
146
147Now you know this three services, and you get a simple interface to interact
148with your MapServer WFS and your ZOO-Project WPS Servers, you are ready to use
149the Services in a different way, by chaining them using the JavaScript ZOO-API to build
150more complexe and powerfull services.
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png