1 | |
---|
2 | |
---|
3 | <!DOCTYPE html> |
---|
4 | <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> |
---|
5 | <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> |
---|
6 | <head> |
---|
7 | <meta charset="utf-8"> |
---|
8 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
---|
9 | |
---|
10 | <title>Building blocks presentation - Using OGR and PgRouting based Web Services — ZOO-Project 1.4a0 documentation</title> |
---|
11 | |
---|
12 | <link href="http://fonts.googleapis.com/css?family=Days+One" rel="stylesheet" type="text/css"> |
---|
13 | |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | <link rel="search" type="application/opensearchdescription+xml" title="Search within ZOO-Project 1.4a0 documentation" href="../../_static/opensearch.xml"/> |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | |
---|
28 | <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | <link rel="top" title="ZOO-Project 1.4a0 documentation" href="../../index.html"/> |
---|
35 | |
---|
36 | |
---|
37 | <script src="_static/js/modernizr.min.js"></script> |
---|
38 | |
---|
39 | </head> |
---|
40 | |
---|
41 | <body class="wy-body-for-nav" role="document"> |
---|
42 | |
---|
43 | <div class="wy-grid-for-nav"> |
---|
44 | |
---|
45 | |
---|
46 | <nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
---|
47 | <div class="wy-side-nav-search"> |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | <a class="shrink" href="../../contents.html"><img src="http://zoo-project.org/img/zoo-sun-logo.png" class="img-responsive sun" style="display: inline;"> ZOO</a> |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | </a> |
---|
56 | |
---|
57 | |
---|
58 | <div role="search"> |
---|
59 | <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> |
---|
60 | <input type="text" name="q" placeholder="Search docs" /> |
---|
61 | <input type="hidden" name="check_keywords" value="yes" /> |
---|
62 | <input type="hidden" name="area" value="default" /> |
---|
63 | </form> |
---|
64 | </div> |
---|
65 | |
---|
66 | |
---|
67 | </div> |
---|
68 | |
---|
69 | <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | <ul> |
---|
74 | <li class="toctree-l1"><a class="reference internal" href="../../intro.html">Introduction</a><ul> |
---|
75 | <li class="toctree-l2"><a class="reference internal" href="../../intro.html#what-is-zoo-project">What is ZOO-Project ?</a></li> |
---|
76 | <li class="toctree-l2"><a class="reference internal" href="../../intro.html#zoo-project-components">ZOO-Project components</a></li> |
---|
77 | <li class="toctree-l2"><a class="reference internal" href="../../intro.html#open-source">Open Source</a></li> |
---|
78 | </ul> |
---|
79 | </li> |
---|
80 | <li class="toctree-l1"><a class="reference internal" href="../../install/index.html">ZOO-Project installation</a><ul> |
---|
81 | <li class="toctree-l2"><a class="reference internal" href="../../install/install-prerequisites.html">Prerequisites</a></li> |
---|
82 | <li class="toctree-l2"><a class="reference internal" href="../../install/install-download.html">Download</a></li> |
---|
83 | <li class="toctree-l2"><a class="reference internal" href="../../install/install-confoptions.html">Configuration options</a></li> |
---|
84 | <li class="toctree-l2"><a class="reference internal" href="../../install/install-installation.html">Installation on Unix/Linux</a></li> |
---|
85 | <li class="toctree-l2"><a class="reference internal" href="../../install/install-installation.html#installation-on-mac-osx">Installation on Mac OSX</a></li> |
---|
86 | <li class="toctree-l2"><a class="reference internal" href="../../install/install-installation.html#installation-on-windows">Installation on Windows</a></li> |
---|
87 | </ul> |
---|
88 | </li> |
---|
89 | <li class="toctree-l1"><a class="reference internal" href="../../kernel/index.html">ZOO-Kernel</a><ul> |
---|
90 | <li class="toctree-l2"><a class="reference internal" href="../../kernel/what.html">What is ZOO-Kernel ?</a></li> |
---|
91 | <li class="toctree-l2"><a class="reference internal" href="../../kernel/configuration.html">ZOO-Kernel configuration</a></li> |
---|
92 | <li class="toctree-l2"><a class="reference internal" href="../../kernel/mapserver.html">Optional MapServer support</a></li> |
---|
93 | <li class="toctree-l2"><a class="reference internal" href="../../kernel/orfeotoolbox.html">Optional Orfeo Toolbox support</a></li> |
---|
94 | </ul> |
---|
95 | </li> |
---|
96 | <li class="toctree-l1"><a class="reference internal" href="../../services/index.html">ZOO-Services</a><ul> |
---|
97 | <li class="toctree-l2"><a class="reference internal" href="../../services/introduction.html">What are ZOO-Services ?</a></li> |
---|
98 | <li class="toctree-l2"><a class="reference internal" href="../../services/zcfg-reference.html">ZOO-Service configuration file</a></li> |
---|
99 | <li class="toctree-l2"><a class="reference internal" href="../../services/process-profiles.html">Process profiles registry</a></li> |
---|
100 | <li class="toctree-l2"><a class="reference internal" href="../../services/howtos.html">Create your own ZOO-Services</a></li> |
---|
101 | <li class="toctree-l2"><a class="reference internal" href="../../services/status.html">ZOO Status Service</a></li> |
---|
102 | <li class="toctree-l2"><a class="reference internal" href="../../services/debug.html">How To Debug ZOO Services</a></li> |
---|
103 | <li class="toctree-l2"><a class="reference internal" href="../../services/zoo-services.html">Available ZOO-Services</a></li> |
---|
104 | </ul> |
---|
105 | </li> |
---|
106 | <li class="toctree-l1"><a class="reference internal" href="../../api/index.html">ZOO-API</a><ul> |
---|
107 | <li class="toctree-l2"><a class="reference internal" href="../../api/what.html">What is ZOO-API ?</a></li> |
---|
108 | <li class="toctree-l2"><a class="reference internal" href="../../api/howto.html">Using ZOO-API</a></li> |
---|
109 | <li class="toctree-l2"><a class="reference internal" href="../../api/classes.html">ZOO-API Classes</a></li> |
---|
110 | <li class="toctree-l2"><a class="reference internal" href="../../api/examples.html">Examples</a></li> |
---|
111 | </ul> |
---|
112 | </li> |
---|
113 | <li class="toctree-l1"><a class="reference internal" href="../../client/index.html">ZOO-Client</a><ul> |
---|
114 | <li class="toctree-l2"><a class="reference internal" href="../../client/what.html">What is ZOO-Client ?</a></li> |
---|
115 | <li class="toctree-l2"><a class="reference internal" href="../../client/howto.html">Using ZOO-Client</a></li> |
---|
116 | <li class="toctree-l2"><a class="reference internal" href="../../client/example.html">Example application</a></li> |
---|
117 | </ul> |
---|
118 | </li> |
---|
119 | </ul> |
---|
120 | |
---|
121 | |
---|
122 | |
---|
123 | </div> |
---|
124 | |
---|
125 | </nav> |
---|
126 | |
---|
127 | <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> |
---|
128 | |
---|
129 | |
---|
130 | <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> |
---|
131 | <i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
---|
132 | <a href="../../contents.html">ZOO-Project</a> |
---|
133 | </nav> |
---|
134 | |
---|
135 | |
---|
136 | |
---|
137 | <div class="wy-nav-content"> |
---|
138 | <div class="rst-content"> |
---|
139 | <div role="navigation" aria-label="breadcrumbs navigation"> |
---|
140 | <ul class="wy-breadcrumbs"> |
---|
141 | |
---|
142 | <li><a href="../../contents.html"> Docs</a> ∕  </li> |
---|
143 | |
---|
144 | <li>Building blocks presentation - Using OGR and PgRouting based Web Services</li> |
---|
145 | <li class="wy-breadcrumbs-aside"> |
---|
146 | |
---|
147 | <a href="../../_sources/workshop/2014/building_blocks_presentation.txt" rel="nofollow"> View page source</a> |
---|
148 | |
---|
149 | </li> |
---|
150 | </ul> |
---|
151 | <hr/> |
---|
152 | </div> |
---|
153 | <div role="main" class="document"> |
---|
154 | |
---|
155 | <div class="section" id="building-blocks-presentation-using-ogr-and-pgrouting-based-web-services"> |
---|
156 | <span id="ogr-base-vect-ops"></span><h1><a class="toc-backref" href="#table-of-contents">Building blocks presentation - Using OGR and PgRouting based Web Services</a><a class="headerlink" href="#building-blocks-presentation-using-ogr-and-pgrouting-based-web-services" title="Permalink to this headline">¶</a></h1> |
---|
157 | <div class="contents topic" id="table-of-contents"> |
---|
158 | <p class="topic-title first">Table of Contents</p> |
---|
159 | <ul class="simple"> |
---|
160 | <li><a class="reference internal" href="#building-blocks-presentation-using-ogr-and-pgrouting-based-web-services" id="id1">Building blocks presentation - Using OGR and PgRouting based Web Services</a><ul> |
---|
161 | <li><a class="reference internal" href="#introduction" id="id2">Introduction</a></li> |
---|
162 | <li><a class="reference internal" href="#services-provider-and-configuration-files" id="id3">Services Provider and configuration files</a></li> |
---|
163 | <li><a class="reference internal" href="#the-buffer-service" id="id4">The Buffer Service</a></li> |
---|
164 | <li><a class="reference internal" href="#the-intersection-service" id="id5">The Intersection Service</a></li> |
---|
165 | <li><a class="reference internal" href="#the-differencepy-service" id="id6">The DifferencePy Service</a></li> |
---|
166 | <li><a class="reference internal" href="#the-routing-and-profile-services" id="id7">The Routing and Profile Services</a></li> |
---|
167 | <li><a class="reference internal" href="#conclusion" id="id8">Conclusion</a></li> |
---|
168 | </ul> |
---|
169 | </li> |
---|
170 | </ul> |
---|
171 | </div> |
---|
172 | <div class="section" id="introduction"> |
---|
173 | <h2><a class="toc-backref" href="#table-of-contents">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2> |
---|
174 | <p>In this section, you will use basic ZOO-Services : <code class="docutils literal"><span class="pre">Buffer</span></code>, |
---|
175 | <code class="docutils literal"><span class="pre">Intersection</span></code> and <code class="docutils literal"><span class="pre">DifferencePy</span></code> which use OGR and psycopg Python modules. |
---|
176 | The intended goal of this section is to present and interact with your new building blocks before chaining them in the next section.</p> |
---|
177 | <p>First of all, you should use the following links to access the user |
---|
178 | interfaces and interact with your services, the first one is used to |
---|
179 | access basic spatial-tools demo client interface and the second to |
---|
180 | access the routing application :</p> |
---|
181 | <blockquote> |
---|
182 | <div><ul class="simple"> |
---|
183 | <li><a class="reference external" href="http://localhost/zoo-ws/spatialtools-py.html">http://localhost/zoo-ws/spatialtools-py.html</a></li> |
---|
184 | <li><a class="reference external" href="http://localhost/zoo-ws/">http://localhost/zoo-ws/</a></li> |
---|
185 | </ul> |
---|
186 | </div></blockquote> |
---|
187 | </div> |
---|
188 | <div class="section" id="services-provider-and-configuration-files"> |
---|
189 | <h2><a class="toc-backref" href="#table-of-contents">Services Provider and configuration files</a><a class="headerlink" href="#services-provider-and-configuration-files" title="Permalink to this headline">¶</a></h2> |
---|
190 | <p>First you may verify if the ZOO-Services are available from your current setup. |
---|
191 | You can take a look at the <code class="docutils literal"><span class="pre">Buffer.zcfg</span></code>, <code class="docutils literal"><span class="pre">Intersection.zcfg</span></code> and |
---|
192 | <code class="docutils literal"><span class="pre">DifferencePy.zcfg</span></code> to get details about parameters. |
---|
193 | As you can see from the ZCFG files, you will use ZOO-Services provided by the |
---|
194 | <code class="docutils literal"><span class="pre">service</span></code> Python service provider. So if you want to modify the Python code |
---|
195 | you will have to edit the corresponding file (so <code class="docutils literal"><span class="pre">service.py</span></code>). |
---|
196 | You are invited to use similar requests as the one used in previous |
---|
197 | sections to learn about each services individually.</p> |
---|
198 | </div> |
---|
199 | <div class="section" id="the-buffer-service"> |
---|
200 | <h2><a class="toc-backref" href="#table-of-contents">The Buffer Service</a><a class="headerlink" href="#the-buffer-service" title="Permalink to this headline">¶</a></h2> |
---|
201 | <p>First click on a street then once the street is displayed in blue, click the |
---|
202 | ‘Buffer’ button on top, you should get similar result as displayed in the following.</p> |
---|
203 | <a class="reference internal image-reference" href="../../_images/Buffer_Level_15.png"><img alt="../../_images/Buffer_Level_15.png" class="align-center" src="../../_images/Buffer_Level_15.png" style="width: 650px;" /></a> |
---|
204 | <p>Since version ZOO-Project 1.2.0, you can run automatically some basic tests to |
---|
205 | make sure that you wrote a correct ZCFG file and your service is validating.</p> |
---|
206 | <div class="admonition note"> |
---|
207 | <p class="first admonition-title">Note</p> |
---|
208 | <p class="last">the current testing is really simple and should be adapted to each Services |
---|
209 | Provider, mainly to define input names.</p> |
---|
210 | </div> |
---|
211 | <p>You can use the following command:</p> |
---|
212 | <div class="highlight-bash"><div class="highlight"><pre><span class="nb">cd</span> /home/user/zoo/testing |
---|
213 | ./run.sh http://localhost/cgi-bin/zoo_loader.cgi Buffer |
---|
214 | </pre></div> |
---|
215 | </div> |
---|
216 | <div class="admonition note"> |
---|
217 | <p class="first admonition-title">Note</p> |
---|
218 | <p class="last">During or after the test run, you can take a look inside the <code class="docutils literal"><span class="pre">tmp</span></code> directory |
---|
219 | which contains both the XML requests send to the ZOO Kernel (<code class="docutils literal"><span class="pre">*1.xml</span></code>) and the |
---|
220 | responses it gave (<code class="docutils literal"><span class="pre">output*.xml</span></code>).</p> |
---|
221 | </div> |
---|
222 | </div> |
---|
223 | <div class="section" id="the-intersection-service"> |
---|
224 | <h2><a class="toc-backref" href="#table-of-contents">The Intersection Service</a><a class="headerlink" href="#the-intersection-service" title="Permalink to this headline">¶</a></h2> |
---|
225 | <p>Using the same client interface as before, once you get a Buffer, you can then |
---|
226 | select a street intersecting the Buffer geometry to compute intersection by clicking on the Intersection button.</p> |
---|
227 | <a class="reference internal image-reference" href="../../_images/Intersection_Level_15.png"><img alt="../../_images/Intersection_Level_15.png" class="align-center" src="../../_images/Intersection_Level_15.png" style="width: 650px;" /></a> |
---|
228 | </div> |
---|
229 | <div class="section" id="the-differencepy-service"> |
---|
230 | <h2><a class="toc-backref" href="#table-of-contents">The DifferencePy Service</a><a class="headerlink" href="#the-differencepy-service" title="Permalink to this headline">¶</a></h2> |
---|
231 | <p>Using the same instructions as for Intersetion, you can get the following result.</p> |
---|
232 | <a class="reference internal image-reference" href="../../_images/Difference_Level_15.png"><img alt="../../_images/Difference_Level_15.png" class="align-center" src="../../_images/Difference_Level_15.png" style="width: 650px;" /></a> |
---|
233 | </div> |
---|
234 | <div class="section" id="the-routing-and-profile-services"> |
---|
235 | <h2><a class="toc-backref" href="#table-of-contents">The Routing and Profile Services</a><a class="headerlink" href="#the-routing-and-profile-services" title="Permalink to this headline">¶</a></h2> |
---|
236 | <p>First click on the blue flag then place your starting point on the |
---|
237 | map, do the same with the red flag to get the shortest path computed |
---|
238 | by the dedicated service and then display its profile. Note that when |
---|
239 | you pass the mouse over the profile display then you will see its |
---|
240 | corresponding position displayed on the map. You can also click on a |
---|
241 | specific step in your path to get the corresponding line displayed.</p> |
---|
242 | <a class="reference internal image-reference" href="../../_images/Routing_Basic.png"><img alt="../../_images/Routing_Basic.png" class="align-center" src="../../_images/Routing_Basic.png" style="width: 650px;" /></a> |
---|
243 | <p>If you take a look in the file: <code class="docutils literal"><span class="pre">/usr/lib/cgi-bin/routing/do.zcfg</span></code> |
---|
244 | you may notice something new in the supported format which is |
---|
245 | reproduced here after.</p> |
---|
246 | <div class="highlight-guess"><div class="highlight"><pre><span class="nt"><Supported></span> |
---|
247 | mimeType = image/png |
---|
248 | asReference = true |
---|
249 | msStyle = STYLE COLOR 125 0 105 OUTLINECOLOR 0 0 0 WIDTH 3 END |
---|
250 | useMapServer = true |
---|
251 | extension = json |
---|
252 | <span class="nt"></Supported></span> |
---|
253 | </pre></div> |
---|
254 | </div> |
---|
255 | <p>The <code class="docutils literal"><span class="pre">mimeType</span></code> is defined as <code class="docutils literal"><span class="pre">image/png</span></code> and there is two new |
---|
256 | parameter which are both optional:</p> |
---|
257 | <blockquote> |
---|
258 | <div><ul class="simple"> |
---|
259 | <li><code class="docutils literal"><span class="pre">useMapServer</span></code>: which make you able to inform the ZOO-Kernel |
---|
260 | that it have to use MapServer to publish your result as WMS / WFS or WCS (this last |
---|
261 | won’t be used in this workshop) rather than simply storing the |
---|
262 | result as a file.</li> |
---|
263 | <li><code class="docutils literal"><span class="pre">msStyle</span></code>: which let you define your own MapServer <code class="docutils literal"><span class="pre">STYLE</span></code> block definition.</li> |
---|
264 | </ul> |
---|
265 | </div></blockquote> |
---|
266 | <p>When you need to access a result many time or for different purpose |
---|
267 | accross other services then it is really useful to ask ZOO-Kernel to |
---|
268 | publish your result as WMS, WFS or WCS.</p> |
---|
269 | <p>Note that no modification of the code of the do service was required |
---|
270 | to handle automatic pubilcation of the result as it is a vector format |
---|
271 | supported by OGR, only modification of the zcfg was required.</p> |
---|
272 | <p>This routing example is here to illustrate how easy it is to publish |
---|
273 | your result as WMS, WFS or WCS ressource. Indeed, when your routing |
---|
274 | service was called, ZOO-Kernel published the result as WMS and WFS |
---|
275 | ressources which was both used first for the UI purpose, the WMS to |
---|
276 | display the resulting path on the map, the WFS for displaying details |
---|
277 | about each steps. The WFS protocol is also used as the input value |
---|
278 | for the profile computation. So, the computation was run once |
---|
279 | and accessed three times for different purposes and from different |
---|
280 | clients.</p> |
---|
281 | <p>For more informations about the MapServer support, please refer to <a class="reference external" href="http://zoo-project.org/docs/kernel/mapserver.html">the |
---|
282 | official ZOO-Project Documentation</a>.</p> |
---|
283 | </div> |
---|
284 | <div class="section" id="conclusion"> |
---|
285 | <h2><a class="toc-backref" href="#table-of-contents">Conclusion</a><a class="headerlink" href="#conclusion" title="Permalink to this headline">¶</a></h2> |
---|
286 | <p>Now you know this three services, and you get a simple interface to interact |
---|
287 | with your MapServer WFS and your ZOO-Project WPS Servers, you are ready to use |
---|
288 | the Services in a different way, by chaining them using the JavaScript ZOO-API to build |
---|
289 | more complexe and powerfull services.</p> |
---|
290 | </div> |
---|
291 | </div> |
---|
292 | |
---|
293 | |
---|
294 | </div> |
---|
295 | <footer> |
---|
296 | |
---|
297 | |
---|
298 | <hr/> |
---|
299 | <div class="pfoot"> |
---|
300 | <div role="contentinfo"> |
---|
301 | <p> |
---|
302 | © Copyright 2009-2015, ZOO-Project team. |
---|
303 | </p> |
---|
304 | </div> |
---|
305 | Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> inspired by <a href="https://readthedocs.org">Read the Docs</a>. |
---|
306 | </div> |
---|
307 | </footer> |
---|
308 | |
---|
309 | </div> |
---|
310 | </div> |
---|
311 | |
---|
312 | </section> |
---|
313 | |
---|
314 | </div> |
---|
315 | |
---|
316 | |
---|
317 | |
---|
318 | |
---|
319 | |
---|
320 | <script type="text/javascript"> |
---|
321 | var DOCUMENTATION_OPTIONS = { |
---|
322 | URL_ROOT:'../../', |
---|
323 | VERSION:'1.4a0', |
---|
324 | COLLAPSE_INDEX:false, |
---|
325 | FILE_SUFFIX:'.html', |
---|
326 | HAS_SOURCE: true |
---|
327 | }; |
---|
328 | </script> |
---|
329 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
---|
330 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
---|
331 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
---|
332 | |
---|
333 | |
---|
334 | |
---|
335 | |
---|
336 | |
---|
337 | <script type="text/javascript" src="../../_static/js/theme.js"></script> |
---|
338 | |
---|
339 | |
---|
340 | |
---|
341 | |
---|
342 | <script type="text/javascript"> |
---|
343 | jQuery(function () { |
---|
344 | SphinxRtdTheme.StickyNav.enable(); |
---|
345 | }); |
---|
346 | </script> |
---|
347 | |
---|
348 | |
---|
349 | </body> |
---|
350 | </html> |
---|