source: branches/PublicaMundi_David-devel/workshop/2013/_build/html/building_blocks_presentation.html @ 686

Last change on this file since 686 was 686, checked in by nbozon, 9 years ago

added workshop directory at root

File size: 19.3 KB
Line 
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 &mdash; ZOO-Project 1.5 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.5 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.5 documentation" href="index.html"/>
35        <link rel="next" title="Playing with buildign blocks - Creating JavaScript Web Services" href="js_services_chaining.html"/>
36        <link rel="prev" title="Creating your first ZOO Service" href="first_service.html"/> 
37
38 
39  <script src="_static/js/modernizr.min.js"></script>
40
41</head>
42
43<body class="wy-body-for-nav" role="document">
44
45  <div class="wy-grid-for-nav">
46
47   
48    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49      <div class="wy-side-nav-search">
50       
51
52       
53          <a class="shrink" href="http://zoo-project.org"><img src="http://zoo-project.org/img/zoo-sun-logo.png" class="img-responsive sun" style="display: inline;"> ZOO</a>
54       
55
56       
57        </a>
58
59       
60<div role="search">
61  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
62    <input type="text" name="q" placeholder="Search docs" />
63    <input type="hidden" name="check_keywords" value="yes" />
64    <input type="hidden" name="area" value="default" />
65  </form>
66</div>
67
68       
69      </div>
70
71      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
72       
73         
74         
75              <ul class="current">
76<li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a><ul>
77<li class="toctree-l2"><a class="reference internal" href="introduction.html#what-is-zoo">What is ZOO ?</a></li>
78<li class="toctree-l2"><a class="reference internal" href="introduction.html#how-does-zoo-works">How does ZOO works ?</a></li>
79<li class="toctree-l2"><a class="reference internal" href="introduction.html#what-are-we-going-to-do-in-this-workshop">What are we going to do in this workshop?</a></li>
80<li class="toctree-l2"><a class="reference internal" href="introduction.html#usefull-tips-for-reading">Usefull tips for reading</a></li>
81</ul>
82</li>
83<li class="toctree-l1"><a class="reference internal" href="using_zoo_from_osgeolivevm.html">Configuration and ZOO-Kernel use</a><ul>
84<li class="toctree-l2"><a class="reference internal" href="using_zoo_from_osgeolivevm.html#zoo-project-installation">ZOO-Project Installation</a></li>
85<li class="toctree-l2"><a class="reference internal" href="using_zoo_from_osgeolivevm.html#zoo-kernel-configuration">ZOO-Kernel Configuration</a></li>
86<li class="toctree-l2"><a class="reference internal" href="using_zoo_from_osgeolivevm.html#testing-the-zoo-installation-with-getcapabilities">Testing the ZOO installation with GetCapabilities</a></li>
87</ul>
88</li>
89<li class="toctree-l1"><a class="reference internal" href="first_service.html">Creating your first ZOO Service</a><ul>
90<li class="toctree-l2"><a class="reference internal" href="first_service.html#introduction">Introduction</a></li>
91<li class="toctree-l2"><a class="reference internal" href="first_service.html#service-and-publication-process-overview">Service and publication process overview</a></li>
92<li class="toctree-l2"><a class="reference internal" href="first_service.html#creating-your-first-zcfg-file">Creating your first ZCFG file</a></li>
93<li class="toctree-l2"><a class="reference internal" href="first_service.html#test-requests">Test requests</a></li>
94<li class="toctree-l2"><a class="reference internal" href="first_service.html#implementing-the-python-service">Implementing the Python Service</a></li>
95<li class="toctree-l2"><a class="reference internal" href="first_service.html#interracting-with-your-service-using-execute-requests">Interracting with your service using Execute requests</a></li>
96<li class="toctree-l2"><a class="reference internal" href="first_service.html#conclusion">Conclusion</a></li>
97</ul>
98</li>
99<li class="toctree-l1 current"><a class="current reference internal" href="">Building blocks presentation - Using OGR and PgRouting based Web Services</a><ul>
100<li class="toctree-l2"><a class="reference internal" href="#introduction">Introduction</a></li>
101<li class="toctree-l2"><a class="reference internal" href="#services-provider-and-configuration-files">Services Provider and configuration files</a></li>
102<li class="toctree-l2"><a class="reference internal" href="#the-buffer-service">The Buffer Service</a></li>
103<li class="toctree-l2"><a class="reference internal" href="#the-intersection-service">The Intersection Service</a></li>
104<li class="toctree-l2"><a class="reference internal" href="#the-differencepy-service">The DifferencePy Service</a></li>
105<li class="toctree-l2"><a class="reference internal" href="#the-routing-and-profile-services">The Routing and Profile Services</a></li>
106<li class="toctree-l2"><a class="reference internal" href="#conclusion">Conclusion</a></li>
107</ul>
108</li>
109<li class="toctree-l1"><a class="reference internal" href="js_services_chaining.html">Playing with buildign blocks - Creating JavaScript Web Services</a><ul>
110<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#introduction">Introduction</a></li>
111<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#zoo-api-overview">ZOO-API Overview</a></li>
112<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#the-mask-service">The Mask Service</a></li>
113<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#buffermask-service">BufferMask Service</a></li>
114<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#bufferrequest-service">BufferRequest service</a></li>
115<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#add-union-into-the-chain">Add Union into the chain</a></li>
116<li class="toctree-l2"><a class="reference internal" href="js_services_chaining.html#conclusion">Conclusion</a></li>
117</ul>
118</li>
119</ul>
120
121         
122       
123      </div>
124      &nbsp;
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="index.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="index.html"> Docs</a> &#8725; &#160;</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/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.
176The 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
178interfaces and interact with your services, the first one is used to
179access basic spatial-tools demo client interface and  the second to
180access the routing application :</p>
181<blockquote>
182<div><ul class="simple">
183<li><a class="reference external" href="http://localhost/zoows2013-demo/spatialtools-py.html">http://localhost/zoows2013-demo/spatialtools-py.html</a></li>
184<li><a class="reference external" href="http://localhost/zoo-ws2013/">http://localhost/zoo-ws2013/</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.
191You 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.
193As 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
195you will have to edit the corresponding file (so <code class="docutils literal"><span class="pre">service.py</span></code>).
196You are invited to use similar requests as the one used in previous
197sections 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&#8216;Buffer&#8217; 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
205make 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
209Provider, 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
219which contains both the XML requests send to the ZOO Kernel (<code class="docutils literal"><span class="pre">*1.xml</span></code>) and the
220responses 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
226select 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
237map, do the same with the red flag to get the shortest path computed
238by the dedicated service and then display its profile. Note that when
239you pass the mouse over the profile display then you will see its
240corresponding position displayed on the map. You can also click on a
241specific 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>
244you may notice something new in the supported format which is
245reproduced here after.</p>
246<div class="highlight-guess"><div class="highlight"><pre><span class="nt">&lt;Supported&gt;</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">&lt;/Supported&gt;</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
256parameter 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
260that it have to use MapServer to publish your result as WMS / WFS or WCS (this last
261won&#8217;t be used in this workshop) rather than simply storing the
262result 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
267accross other services then it is really useful to ask ZOO-Kernel to
268publish your result as WMS, WFS or WCS.</p>
269<p>Note that no modification of the code of the do service was required
270to handle automatic pubilcation of the result as it is a vector format
271supported 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
273your result as WMS, WFS or WCS ressource. Indeed, when your routing
274service was called, ZOO-Kernel published the result as WMS and WFS
275ressources which was both used first for the UI purpose, the WMS to
276display the resulting path on the map, the WFS for displaying details
277about each steps. The WFS protocol is also used as the input value
278for the profile computation. So, the computation was run once
279and accessed three times for different purposes and from different
280clients.</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
282official  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
287with your MapServer WFS and your ZOO-Project WPS Servers, you are ready to use
288the Services in a different way, by chaining them using the JavaScript ZOO-API to build
289more complexe and powerfull services.</p>
290</div>
291</div>
292
293
294          </div>
295          <footer>
296 
297    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
298     
299        <a href="js_services_chaining.html" class="btn btn-neutral float-right" title="Playing with buildign blocks - Creating JavaScript Web Services">Next <span class="fa fa-arrow-circle-right"></span></a>
300     
301     
302        <a href="first_service.html" class="btn btn-neutral" title="Creating your first ZOO Service"><span class="fa fa-arrow-circle-left"></span> Previous</a>
303     
304    </div>
305 
306
307  <hr/>
308  <div class="pfoot">
309  <div role="contentinfo">
310    <p>
311        &copy; Copyright 2009-2015, ZOO-Project team.
312    </p>
313  </div>
314  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>.
315</div>
316</footer>
317
318        </div>
319      </div>
320
321    </section>
322
323  </div>
324 
325
326
327 
328
329    <script type="text/javascript">
330        var DOCUMENTATION_OPTIONS = {
331            URL_ROOT:'./',
332            VERSION:'1.5',
333            COLLAPSE_INDEX:false,
334            FILE_SUFFIX:'.html',
335            HAS_SOURCE:  true
336        };
337    </script>
338      <script type="text/javascript" src="_static/jquery.js"></script>
339      <script type="text/javascript" src="_static/underscore.js"></script>
340      <script type="text/javascript" src="_static/doctools.js"></script>
341
342 
343
344 
345 
346    <script type="text/javascript" src="_static/js/theme.js"></script>
347 
348
349 
350 
351  <script type="text/javascript">
352      jQuery(function () {
353          SphinxRtdTheme.StickyNav.enable();
354      });
355  </script>
356   
357
358</body>
359</html>
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