Index: /trunk/workshop-routing-foss4g/make.bat
===================================================================
--- /trunk/workshop-routing-foss4g/make.bat	(revision 63)
+++ /trunk/workshop-routing-foss4g/make.bat	(revision 63)
@@ -0,0 +1,113 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+set SPHINXBUILD=sphinx-build
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html      to make standalone HTML files
+	echo.  dirhtml   to make HTML files named index.html in directories
+	echo.  pickle    to make pickle files
+	echo.  json      to make JSON files
+	echo.  htmlhelp  to make HTML files and a HTML help project
+	echo.  qthelp    to make HTML files and a qthelp project
+	echo.  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  changes   to make an overview over all changed/added/deprecated items
+	echo.  linkcheck to check all external links for integrity
+	echo.  doctest   to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Workshop-FOSS4GroutingwithpgRoutingtoolsOpenStreetMaproaddataandGeoExt.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Workshop-FOSS4GroutingwithpgRoutingtoolsOpenStreetMaproaddataandGeoExt.ghc
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
+)
+
+if "%1" == "linkcheck" (
+	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+	echo.
+	echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+	goto end
+)
+
+if "%1" == "doctest" (
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+	echo.
+	echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+	goto end
+)
+
+:end
Index: /trunk/workshop-routing-foss4g/latex.rst
===================================================================
--- /trunk/workshop-routing-foss4g/latex.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/latex.rst	(revision 63)
@@ -0,0 +1,23 @@
+.. Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt documentation master file, created by
+   sphinx-quickstart on Sat Jul  3 21:23:22 2010.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+==============================================================================================================
+pgRouting Workshop - Latex generation (doesn't include this page)
+==============================================================================================================
+
+.. toctree::
+   :numbered:
+   :maxdepth: 3
+
+   chapters/introduction.rst
+   chapters/about.rst
+   chapters/installation.rst
+   chapters/osm2pgrouting.rst
+   chapters/topology.rst
+   chapters/shortest_path.rst
+   chapters/advanced.rst
+   chapters/php_server.rst
+   chapters/geoext_client.rst
+
Index: /trunk/workshop-routing-foss4g/chapters/geoext_client.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/geoext_client.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/geoext_client.rst	(revision 63)
@@ -0,0 +1,369 @@
+==============================================================================================================
+GeoExt Browser Client
+==============================================================================================================
+
+`GeoExt <http://www.geoext.org/>`_ is a *JavaScript Toolkit for Rich Web Mapping Applications*. GeoExt
+brings together the geospatial know how of `OpenLayers <http://www.openlayers.org>`_ with
+the user interface savvy of `Ext JS <http://www.sencha.com>`_ to help you build powerful desktop
+style GIS apps on the web with JavaScript.
+
+Let's start with a simple GeoExt example and extend it with routing functionality then:
+
+.. literalinclude:: ../../web/routing-0.html
+	:language: html
+
+In the header we include all the javascript and css needed for the application,
+we also define a function to be run when the page is loaded (Ext.onReady).
+
+This function creates a `GeoExt.MapPanel
+<http://www.geoext.org/lib/GeoExt/widgets/MapPanel.html>`_ with an
+OpenStreetMap layer centered to Denver. In this code, no OpenLayers.Map is
+explicitly created; the GeoExt.MapPanel do this under the hood: it takes the map options, the
+center and the zoom and create a map instance accordingly.
+
+To allow our users to get directions, we need to provide:
+ * a way to select the routing algorithm (Shortest path Dijkstra, A* or Shooting*),
+ * a way to select the start and final destination.
+
+.. note:: This chapter only show code snippets, the full source code of the
+ page can be found in ``pgrouting-workshop/web/routing-final.html`` that should
+ be on your desktop. The full listing can also be found at the end of this chapter.
+
+-------------------------------------------------------------------------------------------------------------
+Routing method selection
+-------------------------------------------------------------------------------------------------------------
+
+To select the routing method, we will use an `Ext.form.ComboBox
+<http://www.sencha.com/deploy/dev/docs/?class=Ext.form.ComboBox>`_: it
+behaves just like a normal html select but we can more easily control it.
+
+Just like the GeoExt.MapPanel, we need an html element to place our control,
+let's create a new div in the body (with 'method' as id):
+
+ .. code-block:: html
+
+   <body>
+     <div id="gxmap"></div>
+     <div id="method"></div>
+   </body>
+
+Then we create the combo itself:
+ .. code-block:: js
+
+   var method = new Ext.form.ComboBox({
+       renderTo: "method",
+       triggerAction: "all",
+       editable: false,
+       forceSelection: true,
+       store: [
+           ["SPD", "Shortest Path Dijkstra"],
+           ["SPA", "Shortest Path A*"],
+           ["SPS", "Shortest Path Shooting*"]
+       ]
+   });
+
+In the ``store`` option, we set all the possible values for the routing method;
+the format is an array of options where an option is in the form ``[key, name]``.
+The ``key`` will be send to the server (the php script in our case) and the
+``value`` displayed in the combo.
+
+The ``renderTo`` specify where the combo must be rendered, we use our new div here.
+
+And finally, a default value is selected:
+ .. code-block:: js
+
+    method.setValue("SPD");
+
+This part only uses ExtJS component: no OpenLayers or GeoExt code here.
+
+-------------------------------------------------------------------------------------------------------------
+Select the start and final destination
+-------------------------------------------------------------------------------------------------------------
+
+We want to allow the users to draw and move the start and final destination
+points. This is more or less the behavior of google maps and others: the user
+selects the points via a search box (address search) or by clicking the
+map. The system query the server and display the route on the map. The user
+can later move the start or final point and the route is updated.
+
+In this workshop, we will only implement the input via the map (draw points and
+drag-and-drop) but it's possible to implement the search box feature by using a
+web service like `GeoNames <http://www.geonames.org/>`_ or any other `geocoding
+<http://en.wikipedia.org/wiki/Geocoding>`_ service.
+
+To do this we will need a tool to draw points (we will use the
+`OpenLayers.Control.DrawFeatures
+<http://openlayers.org/dev/examples/draw-feature.html>`_ control) and a tool to
+move points (`OpenLayers.Control.DragFeatures
+<http://openlayers.org/dev/examples/drag-feature.html>`_ will be perfect for
+this job). As their name suggests these controls comes from OpenLayers.
+
+These two controls will need a place to draw and manipulate the points; we
+will also need an `OpenLayers.Layer.Vector
+<http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Layer/Vector-js.html>`_
+layer. In OpenLayers, a vector layer in a place where features (a geometry and
+attributes) can be drawn programmatically (in contrast, the OSM layer is a
+raster layer).
+
+Because vector layers are cheap, we will use a second one to draw the route
+returned by the web service. The layers initialization is:
+
+ .. code-block:: js
+
+    // create the layer where the route will be drawn
+    var route_layer = new OpenLayers.Layer.Vector("route", {
+        styleMap: new OpenLayers.StyleMap(new OpenLayers.Style({
+            strokeColor: "#ff9933",
+            strokeWidth: 3
+        }))
+    });
+
+``"route"`` is the layer name, any string can be used.
+``styleMap`` gives the layer a bit of visual style with a custom stroke color and
+width (in pixel).
+
+The second layer initialization is simply:
+
+ .. code-block:: js
+
+    // create the layer where the start and final points will be drawn
+    var points_layer = new OpenLayers.Layer.Vector("points");
+
+The two layers are added to the OpenLayers.Map object with:
+
+ .. code-block:: js
+
+    // add the layers to the map
+    map.addLayers([points_layer, route_layer]);
+
+Let's look at the control to draw the points: because this component has
+special behavior it's more easy to create a new class based on the standard
+OpenLayers.Control.DrawFeatures control. This new control (named DrawPoints) is
+saved in a separated javascript file (``web/DrawPoints.js``):
+
+.. literalinclude:: ../../web/DrawPoints.js
+	:language: js
+
+In the ``initialize`` function (that's the class constructor) we set that
+this control can only draw points (handler variable is OpenLayers.Handler.Point).
+
+The special behavior is implemented in the ``drawFeature`` function: because we
+only need the start and final points the control deactivates itself when two
+points are drawn by counting how many features has the vector
+layer. Control deactivation is ``this.deactivate()``.
+
+Our control is then created with:
+
+ .. code-block:: js
+
+    // create the control to draw the points (see the DrawPoints.js file)
+    var draw_points = new DrawPoints(points_layer);
+
+``points_layer`` is the vector layer created earlier.
+
+And now for the DragFeature control:
+
+ .. code-block:: js
+
+    // create the control to move the points
+    var drag_points = new OpenLayers.Control.DragFeature(points_layer, {
+        autoActivate: true
+    });
+
+Again, ``points_layer`` is the vector layer, ``autoActivate: true`` tells
+OpenLayers that we want this control to be automatically activated.
+
+ .. code-block:: js
+
+    // add the controls to the map
+    map.addControls([draw_points, drag_points]);
+
+Adds the controls to the map.
+
+-------------------------------------------------------------------------------------------------------------
+Call and receive data from web service
+-------------------------------------------------------------------------------------------------------------
+
+The basic workflow to get a route from the web server is:
+
+#. transform our points coordinates from EPSG:900913 to EPSG:4326
+#. call the web service with the correct arguments (method name and two points coordinates)
+#. parse the web service response: transform GeoJSON to OpenLayers.Feature.Vector
+#. transform all the coordinates from EPSG:4326 to EPSG:900913
+#. add this result to a vector layer
+
+The first item is something new: our map uses the EPSG:900913 projection
+(because we use an OSM layer) but the web service expects coordinates in
+EPSG:4326: we have to re-project the data before sending them. This is not a
+big deal: we will simply use the `Proj4js <http://trac.osgeo.org/proj4js/>`_
+javascript library.
+
+(The second item *call the web service* is covered in the next chapter.)
+
+The routing web service in pgrouting.php returns a `GeoJSON
+<http://geojson.org/>`_ FeatureCollection object. A FeatureCollection is simply
+an array of features: one feature for each route segment. This is very convenient because
+OpenLayers and GeoExt have all what we need to handle this format. To make our
+live even easier, we are going to use the GeoExt.data.FeatureStore:
+
+ .. code-block:: js
+
+    var store = new GeoExt.data.FeatureStore({
+        layer: route_layer,
+        fields: [
+            {name: "length"}
+        ],
+        proxy: new GeoExt.data.ProtocolProxy({
+            protocol: new OpenLayers.Protocol.HTTP({
+                url: './php/pgrouting.php',
+                format: new OpenLayers.Format.GeoJSON({
+                    internalProjection: epsg_900913,
+                    externalProjection: epsg_4326
+                })
+            })
+        })
+    });
+
+A store is simply a container to store informations: we can push data into and
+get it back.
+
+Let's explain all the options:
+
+``layer``: the argument is a vector layer: by specifying a layer, the
+FeatureStore will automatically draw the data received into this
+layer. This is exactly what we need for the last item (*add this result to a
+vector layer*) in the list above.
+
+``fields``: lists all the attributes returned along with the geometry: pgrouting.php
+returns the segment length so we set it here. Note that this information is not
+used in this workshop.
+
+``proxy``: the proxy item specify where the data should be taken: in our case
+from a HTTP server. The proxy type is GeoExt.data.ProtocolProxy: this class
+connects the ExtJS world (the store) and the OpenLayers world (the protocol
+object).
+
+``protocol``: this OpenLayers component is able to make HTTP requests to an ``url``
+(our php script) and to parse the response (``format`` option). By adding the
+``internalProjection`` and ``externalProjection`` option, the coordinates
+re-projection in made by the format.
+
+We now have all what we need to handle the data returned by the web service: the next
+chapter will explain how and when to call the service.
+
+-------------------------------------------------------------------------------------------------------------
+Trigger the web service call
+-------------------------------------------------------------------------------------------------------------
+
+We need to call the web service when:
+ * the two points are drawn
+ * one of the point is moved
+ * the routing method has changed
+
+Our vector layer generates an event (called ``featureadded``) when a
+new feature is added, we can listen to this event and call to pgrouting
+function (this function will be presented shortly):
+
+ .. code-block:: js
+
+    draw_layer.events.on({
+        featureadded: function() {
+            pgrouting(store, draw_layer, method.getValue());
+        }
+    });
+
+.. note:: Before we continue some words about events: an event in OpenLayers
+  (the same apply for ExtJS and other frameworks), is a system to allow a
+  function to be called when *something* happened. For instance when a layer is
+  added to the map or when the mouse is over a feature. Multiple functions can
+  be connected to the same event.
+
+No event is generated when a point is moved, hopefully we can give a
+function to the DragFeature control to be called we the point is moved:
+
+ .. code-block:: js
+
+    drag_points.onComplete = function() {
+        pgrouting(store, draw_layer, method.getValue());
+    };
+
+For the *method* combo, we can add a listeners options to the constructor with
+a `select` argument (that's the event triggered when the user changes the value):
+
+ .. code-block:: js
+
+    var method = new Ext.form.ComboBox({
+        renderTo: "method",
+        triggerAction: "all",
+        editable: false,
+        forceSelection: true,
+        store: [
+            ["SPD", "Shortest Path Dijkstra"],
+            ["SPA", "Shortest Path A*"],
+            ["SPS", "Shortest Path Shooting*"]
+        ],
+        listeners: {
+            select: function() {
+                pgrouting(store, draw_layer, method.getValue());
+            }
+    });
+
+
+It's now time to present the pgrouting function:
+
+ .. code-block:: js
+
+   // global projection objects (uses the proj4js lib)
+   var epsg_4326 = new OpenLayers.Projection("EPSG:4326"), 
+       epsg_900913 = new OpenLayers.Projection("EPSG:900913");
+
+   function pgrouting(store, layer, method) {
+         if (layer.features.length == 2) {
+             // erase the previous route
+             store.removeAll();
+
+             // transform the two geometries from EPSG:900913 to EPSG:4326
+             var startpoint = layer.features[0].geometry.clone();
+             startpoint.transform(epsg_900913, epsg_4326);
+             var finalpoint = layer.features[1].geometry.clone();
+             finalpoint.transform(epsg_900913, epsg_4326);
+
+             // load to route
+             store.load({
+                 params: {
+                     startpoint: startpoint.x + " " + startpoint.y,
+                     finalpoint: finalpoint.x + " " + finalpoint.y,
+                     method: method
+                 }
+             });
+        }
+    }
+
+The pgrouting function calls the web service through the store argument.
+
+At first, the function checks if two points are passed in
+argument. Then, ``store.removeAll()`` is called to erase a previous result
+from the layer (remember that the store and the vector layer are binded).
+The two points coordinates are then projected using OpenLayers.Projection
+instances.
+
+Finally, ``store.load()`` is called with a ``params`` representing the
+pgrouting.php arguments (they are passed to the HTTP GET call).
+
+-------------------------------------------------------------------------------------------------------------
+What's next ?
+-------------------------------------------------------------------------------------------------------------
+
+Possible enhancements:
+ * use a geocoding service to get start/final point
+ * way point support
+ * nice icons for the start and final points
+ * driving directions (road map): we already have the segment length
+
+-------------------------------------------------------------------------------------------------------------
+Full source code
+-------------------------------------------------------------------------------------------------------------
+
+.. literalinclude:: ../../web/routing-final.html
+	:language: html
+
Index: /trunk/workshop-routing-foss4g/chapters/about.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/about.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/about.rst	(revision 63)
@@ -0,0 +1,91 @@
+=============================================================================================================
+Ã propos
+=============================================================================================================
+
+Ces travaux pratiques utilisent de nombreux outils FOSS4G, beaucoup plus que le titre ne le laisse supposer. Ainsi, de nombreux logiciels FOSS4G sont liÃ©s au autres project OpenSource et ce serait aller trop loin de tous les lister. Il y a nÃ©anmoins 4 projets OpenSource que ces travaux pratiues prÃ©senterons :
+
+.. image:: images/osgeo.png
+	:align: center
+
+-------------------------------------------------------------------------------------------------------------
+pgRouting
+-------------------------------------------------------------------------------------------------------------
+
+pgRouting est un extension de PostGIS et ajoute les fonctionalitÃ©s de routing au couple PostGIS/PostgreSQL. pgRouting est un dÃ©veloppement antÃ©rieur Ã  pgDijkstra (par `Camptocamp SA <http://www.camptocamp.com>`_). Il a Ã©tÃ© Ã©tendu par l'entreprise `Orkney Inc. <http://www.orkney.co.jp>`_ et est actuellement dÃ©veloppÃ© et maintenu par `Georepublic <http://georepublic.de>`_.
+
+.. image:: images/pgrouting.png
+	:align: center
+
+pgRouting fournit les fonctions pour :
+
+* Plus court chemin Dikstra : algorithme de routage sans heusitique
+* Plus court chemin A-Ãtoile : routage pour grand un ensemble de donnÃ©es (avec heuristiques)
+* Plus court chemin Shooting-Star: routage prenant en compte le sens giratoir (avec heuristiques)
+* ProblÃšme du voyageur de commerce (TSP)
+* Distance de pilotage (Isolines)
+
+De nombreux nouveaux algorithmes vont Ãªtre ajoutÃ©s dans un futur proche :
+
+* Dial-a-Ride-Problem solver (DARP)
+* Support du routage multimodal 
+* Algortihme de recherche de plus court chemin dÃ©pendant du temps / dynamique
+* A-Ãtoile utilisant deux direction 
+* All-Pair shortest path algorithm
+
+Les avantages de l'approche base de donnÃ©es pour les algorithmes de routage sont :
+
+* L'accessibilitÃ© par nombreux clients au travers de JDBC, ODBC, our directement en tuililsant Pl/pgSQL. Les clients peuvent Ãªtre des ordinateurs personnels ou des pÃ©rifÃ©riques mobiles.
+* Utilise PostGIS pour le format des donnÃ©es gÃ©ographiques, qui utilise le Format Text Bien Connu (WKT) de l'OGC et le Format Binaire Bien Connu (WKB).
+* Les logiciels OpenSource comme qGIS et uDig peuvent modifier les donnÃ©es / les attributs.
+* Les modifications apportÃ©es aux donnÃ©es peuvent Ãªtre intÃ©grÃ©es au moteur de routage instantanÃ©ment. Il n'y pas de besoin de prÃ©-calcul.
+* Le paramÃštre de "coÃ»t" peut Ãªtre calculÃ© dynamiquement Ã  l'aide du SQL et ces valeurs peuvent provenir de diffÃ©rets attributsou tables.
+
+pgRouting est disponible sous licence GPLv2.
+
+Le site web officiel de pgRouting : http://www.pgrouting.org
+
+
+-------------------------------------------------------------------------------------------------------------
+OpenStreetMap
+-------------------------------------------------------------------------------------------------------------
+
+*"OpenStreetMap a pour objectif de crÃ©er et fournir des informations gÃ©ographiques libres telles que des plans de rue Ã  toute personne le dÃ©sirant. Le projet fut dÃ©marrÃ© car la plupart des cartes qui semblent libres ont en fait des restrictions dâutilisation lÃ©gales ou techniques, empÃªchant de les utiliser de maniÃšre crÃ©ative, productive ou tout simplement selon vos souhaits."* (Source: http://wiki.openstreetmap.org/wiki/FR:Portal:Press)
+
+.. image:: images/osm_logo.png
+	:align: center
+
+OpenStreetMap est une source de donnÃ©es parfaite pour Ãªtre utilisÃ©es avec pgRouting, car elles sont librement disponibles et n'ont pas de restrictions techniques en terme d'utilisation. La disponibilitÃ© des donnÃ©es varie d'un pays Ã  un autre, mais la couverture mondiale s'amÃ©liore de jour en jour.
+
+OpenStreetMap utilise une structuration de donnÃ©es topologiques :
+
+* Les noeuds (nodes) sont des points avec une position gÃ©ographique.
+* Les chemins (ways) sont des liste de noeuds, reprÃ©sentant une polyligne ou un polygone.
+* Les relations (relations) sont des groupes de noeud, de chemin et d'autre relations auquelles on peut affecter certaines propriÃ©tÃ©s.
+* Les propriÃ©tÃ©s (tags) peuvent Ãªtre appliquÃ©s Ã  des noeuds, des chemins ou des relation et consistent en un couple nom=valeur.
+
+Site web d'OpenStreetMap : http://www.openstreetmap.org
+
+
+-------------------------------------------------------------------------------------------------------------
+osm2pgrouting
+-------------------------------------------------------------------------------------------------------------
+
+osm2pgrouting est un outils en ligne de commande qui rend simple l'importation de donnÃ©es OpenStreetMap dans une base de donnÃ©es pgRouting. Il contruit le rÃ©seau routier automatiquement et crÃ©e les tables pour les types de donnÃ©es et les classes de routes. osm2pgrouting a Ã©tÃ© Ã©crit initialement par Daniel Wendt et est maintenant disponible sur le site du projet pgRouting.
+
+osm2pgrouting est disponible sous licence GPLv2.
+
+Site web du projet : http://www.pgrouting.org/docs/tools/osm2pgrouting.html
+
+
+-------------------------------------------------------------------------------------------------------------
+GeoExt
+-------------------------------------------------------------------------------------------------------------
+
+GeoExt est une librairie JavaScript destinÃ©e au applications web avancÃ©es. GeoExt rassemble les connaissances gÃ©ospatiales de `OpenLayers <http://www.openlayers.org>`_ avec une interface utilisateurs issue de `Ext JS <http://www.sencha.com>`_ pour aider Ã  construire un application web ressemblant Ã  une application bureautique.
+
+.. image:: images/GeoExt.png
+	:align: center
+
+GeoExt est disponible sous licence BSD et est maintenu par une communautÃ© grandissante d'individus, d'ogranisations et d'entreprises.
+
+Le site web de GeoExt : http://www.geoext.org
Index: /trunk/workshop-routing-foss4g/chapters/topology.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/topology.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/topology.rst	(revision 63)
@@ -0,0 +1,179 @@
+==============================================================================================================
+Create a Network Topology
+==============================================================================================================
+
+:doc:`osm2pgrouting <osm2pgrouting>` is a convenient tool, but it's also a *black box*. There are several cases where :doc:`osm2pgrouting <osm2pgrouting>` can't be used. Obviously if the data isn't OpenStreetMap data. Some network data already comes with a network topology that can be used with pgRouting out-of-the-box. Often network data is stored in Shape file format (``.shp``) and we can use PostGIS' ``shape2postgresql`` converter to import the data into a PostgreSQL database. But what to do then?
+
+.. image:: images/network.png
+	:width: 250pt
+	:align: center
+
+In this chapter you will learn how to create a network topology from scratch. For that we will start with data that contains the minimum attributes needed for routing and show how to proceed step-by-step to build routable data for pgRouting. 
+
+-------------------------------------------------------------------------------------------------------------
+Load network data
+-------------------------------------------------------------------------------------------------------------
+
+At first we will load a database dump from the workshop ``data`` directory. This directory contains a compressed file with database dumps as well as a smaller network data of Denver downtown. If you haven't uncompressed the data yet, extract the file by 
+
+.. code-block:: bash
+
+	cd ~/Desktop/pgrouting-workshop/
+	tar -xvzf data.tar.gz
+
+The following command will import the database dump. It will add PostGIS and pgRouting functions to a database, in the same way as decribed in the previous chapter. It will also load the Denver sample data with a minimum number of attributes, which you will usually find in any network data:
+
+.. code-block:: bash
+
+	# Optional: Drop database
+	dropdb -U postgres pgrouting-workshop
+
+	# Load database dump file
+	psql -U postgres -f ~/Desktop/pgrouting-workshop/data/sampledata_notopo.sql
+
+Let's see wich tables have been created:
+
+.. rubric:: Run: ``psql -U postgres -d pgrouting-workshop -c "\d"``
+	
+.. code-block:: sql
+
+		          List of relations
+	 Schema |       Name        | Type  |  Owner   
+	--------+-------------------+-------+----------
+	 public | classes           | table | postgres
+	 public | geography_columns | view  | postgres
+	 public | geometry_columns  | table | postgres
+	 public | spatial_ref_sys   | table | postgres
+	 public | types             | table | postgres
+	 public | ways              | table | postgres
+	(6 rows)
+
+	
+The table containing the road network data has the name ``ways``. It consists of the following attributes:
+	
+.. rubric:: Run: ``psql -U postgres -d pgrouting-workshop -c "\d ways"``
+	
+.. code-block:: sql
+
+		       Table "public.ways"
+	  Column  |       Type       | Modifiers 
+	----------+------------------+-----------
+	 gid      | integer          | not null
+	 class_id | integer          | 
+	 length   | double precision | 
+	 name     | character(200)   | 
+	 the_geom | geometry         | 
+	Indexes:
+	    "ways_pkey" PRIMARY KEY, btree (gid)
+	    "geom_idx" gist (the_geom)
+	Check constraints:
+	    "enforce_dims_the_geom" CHECK (ndims(the_geom) = 2)
+	    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 
+	              'MULTILINESTRING'::text OR the_geom IS NULL)
+	    "enforce_srid_the_geom" CHECK (srid(the_geom) = 4326)
+
+It is common that road network data provides at least the following information:
+
+* Road link ID (gid)
+* Road class (class_id)
+* Road link length (length)
+* Road name (name)
+* Road geometry (the_geom)
+
+This allows to display the road network as a PostGIS layer in GIS software, for example in QGIS. Though it is not sufficient for routing, because it doesn't contain network topology information.
+
+For the next steps we need to start the PostgreSQL command line tool 
+
+.. code-block:: bash
+
+	psql -U postgres pgrouting-workshop
+	
+... or use PgAdmin III.
+
+
+--------------------------------------------------------------------------------------------------------------
+Calculate topology
+--------------------------------------------------------------------------------------------------------------
+
+Having your data imported into a PostgreSQL database usually requires one more step for pgRouting. You have to make sure that your data provides a correct network topology, which consists of information about source and target ID of each road link.
+
+If your network data doesn't have such network topology information already you need to run the ``assign_vertex_id`` function. This function assigns a ``source`` and a ``target`` ID to each link and it can "snap" nearby vertices within a certain tolerance.
+
+.. code-block:: sql
+
+	assign_vertex_id('<table>', float tolerance, '<geometry column', '<gid>')
+	
+First we have to add source and target column, then we run the assign_vertex_id function ... and wait.:
+
+.. code-block:: sql
+
+	-- Add "source" and "target" column
+	ALTER TABLE ways ADD COLUMN "source" integer;
+	ALTER TABLE ways ADD COLUMN "target" integer;
+	
+	-- Run topology function
+	SELECT assign_vertex_id('ways', 0.00001, 'the_geom', 'gid');
+
+.. note::
+
+	Execute ``psql -U postgres -d pgrouting-workshop`` in your terminal to connect to the database and start the PostgreSQL shell. Leave the shell with ``\q`` command.   
+
+.. warning::
+
+	The dimension of the tolerance parameter depends on your data projection. Usually it's either "degrees" or "meters".
+
+
+-------------------------------------------------------------------------------------------------------------
+Add indices
+-------------------------------------------------------------------------------------------------------------
+
+Fortunately we didn't need to wait too long because the data is small. But your network data might be very large, so it's a good idea to add an index to ``source`` and ``target`` column.
+
+.. code-block:: sql
+
+	CREATE INDEX source_idx ON ways("source");
+	CREATE INDEX target_idx ON ways("target");
+
+After these steps our routing database look like this:
+
+.. rubric:: Run: ``\d``
+	
+.. code-block:: sql
+
+		             List of relations
+	 Schema |        Name         |   Type   |  Owner   
+	--------+---------------------+----------+----------
+	 public | geography_columns   | view     | postgres
+	 public | geometry_columns    | table    | postgres
+	 public | spatial_ref_sys     | table    | postgres
+	 public | vertices_tmp        | table    | postgres
+	 public | vertices_tmp_id_seq | sequence | postgres
+	 public | ways                | table    | postgres
+	(6 rows)
+
+.. rubric:: Run: ``\d ways``
+	
+.. code-block:: sql
+	
+		       Table "public.ways"
+	  Column  |       Type       | Modifiers 
+	----------+------------------+-----------
+	 gid      | integer          | not null
+	 class_id | integer          | 
+	 length   | double precision | 
+	 name     | character(200)   | 
+	 the_geom | geometry         | 
+	 source   | integer          | 
+	 target   | integer          | 
+	Indexes:
+	    "ways_pkey" PRIMARY KEY, btree (gid)
+	    "geom_idx" gist (the_geom)
+	    "source_idx" btree (source)
+	    "target_idx" btree (target)
+	Check constraints:
+	    "enforce_dims_the_geom" CHECK (ndims(the_geom) = 2)
+	    "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 
+	                'MULTILINESTRING'::text OR the_geom IS NULL)
+	    "enforce_srid_the_geom" CHECK (srid(the_geom) = 4326)
+		
+Now we are ready for our first routing query with :doc:`Dijkstra algorithm <shortest_path>`!
Index: /trunk/workshop-routing-foss4g/chapters/php_server.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/php_server.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/php_server.rst	(revision 63)
@@ -0,0 +1,55 @@
+==============================================================================================================
+Server side script with PHP
+==============================================================================================================
+
+We will use a PHP script to make the routing query and send the result back to the web client.
+
+The following steps are necessary:
+
+* Retrieve the start and end point coordinates.
+* Find the closest edge to start/end point.
+* Take either the start or end vertex of this edge (for Dijkstra/ A-Star) or the complete edge (Shooting-Star) as start of the route and end respectively.
+* Make the Shortest Path database query.
+* Transform the query result to XML or better GeoJSON and send it back to the web client.
+
+.. note::
+	
+	To keep this example as simple as possible with focus on routing queries, this PHP script doesn't validate request parameters nore does it deal with PHP security issues. 
+
+Let's start with some PHP template and then place this file in a directory, which is accessible by Apache:
+
+.. literalinclude:: ../../web/php/pgrouting.php
+	:language: php
+	:lines: 1-18
+
+	  
+-------------------------------------------------------------------------------------------------------------
+Closest edge
+-------------------------------------------------------------------------------------------------------------
+
+Usually the start and end point, which we retrieved from the client, is not the start or end vertex of an edge. It is more convenient to look for the closest edge than for the closest vertex, because Shooting Star algorithm is âedge-basedâ. For âvertex-basedâ algorithms (Dijkstra, A-Star) we can choose arbitrary start or end of the selected edge.
+
+.. literalinclude:: ../../web/php/pgrouting.php
+	:language: php
+	:lines: 20-56
+	  
+	  
+-------------------------------------------------------------------------------------------------------------
+Routing query
+-------------------------------------------------------------------------------------------------------------
+
+.. literalinclude:: ../../web/php/pgrouting.php
+	:language: php
+	:lines: 58-116
+
+
+-------------------------------------------------------------------------------------------------------------
+GeoJSON output
+-------------------------------------------------------------------------------------------------------------
+
+OpenLayers allows to draw lines directly using GeoJSON format, so our script returns a GeoJSON FeatureCollection object:
+
+.. literalinclude:: ../../web/php/pgrouting.php
+	:language: php
+	:lines: 118-
+
Index: /trunk/workshop-routing-foss4g/chapters/images/network.pngw
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/images/network.pngw	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/images/network.pngw	(revision 63)
@@ -0,0 +1,6 @@
+3.3579243441145299e-05
+0 
+0 
+-3.3579243441145299e-05
+2.1400889356797999
+41.399318783865887
Index: /trunk/workshop-routing-foss4g/chapters/images/route.pngw
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/images/route.pngw	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/images/route.pngw	(revision 63)
@@ -0,0 +1,6 @@
+3.3579243441145299e-05
+0 
+0 
+-3.3579243441145299e-05
+2.1400889356797999
+41.399318783865887
Index: /trunk/workshop-routing-foss4g/chapters/osm2pgrouting.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/osm2pgrouting.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/osm2pgrouting.rst	(revision 63)
@@ -0,0 +1,151 @@
+==============================================================================================================
+osm2pgrouting Import Tool
+==============================================================================================================
+
+**osm2pgrouting** is a command line tool that makes it very easy to import OpenStreetMap data into a pgRouting database. It builds the routing network topology automatically and creates tables for feature types and road classes. osm2pgrouting was primarily written by Daniel Wendt and is currently hosted on the pgRouting project site: http://www.pgrouting.org/docs/tools/osm2pgrouting.html
+
+.. note::
+
+	There are some limitations, especially regarding the network size. The current version of osm2pgrouting needs to load all data into memory, which makes it fast but also requires a lot or memory for large datasets. An alternative tool to osm2pgrouting without the network size limitation is **osm2po** (http://osm2po.de). It's available under "Freeware License".
+	
+
+Raw OpenStreetMap data contains much more features and information than need for routing. Also the format is not suitable for pgRouting out-of-the-box. An ``.osm`` XML file consists of three major feature types:
+
+* nodes
+* ways
+* relations
+
+The data of sampledata.osm for example looks like this:
+
+.. literalinclude:: code/osm_sample.osm
+	:language: xml
+
+Detailed description of all possible OpenStretMap types and classes can be found here:  http://wiki.openstreetmap.org/index.php/Map_features.
+
+When using osm2pgrouting, we take only nodes and ways of types and classes specified in ``mapconfig.xml`` file that will be imported into the routing database:
+
+.. literalinclude:: code/mapconfig_sample.xml
+	:language: xml
+
+The default ``mapconfig.xml`` is installed in ``/usr/share/osm2pgrouting/``.
+
+
+-------------------------------------------------------------------------------------------------------------
+Create routing database
+-------------------------------------------------------------------------------------------------------------
+
+Before we can run osm2pgrouting we have to create a database and load PostGIS and pgRouting functions into this database. 
+If you have installed the template databases as described in the previous chapter, creating a pgRouting-ready database is done with a single command. Open a terminal window and run:
+
+.. code-block:: bash
+
+	createdb -U postgres -T template_routing routing
+	
+... and you're done.
+
+Alternativly you can use **PgAdmin III** and SQL commands. Start PgAdmin III (available on the LiveDVD), connect to any database and open the SQL Editor and then run the following SQL command:
+
+.. code-block:: sql
+
+	-- create routing database
+	CREATE DATABASE "routing" TEMPLATE "template_routing";
+
+
+Otherwise you need to manually load several files into your database. See :ref:`previous chapter <installation_load_functions>`.
+
+	
+-------------------------------------------------------------------------------------------------------------
+Run osm2pgrouting
+-------------------------------------------------------------------------------------------------------------
+
+The next step is to run ``osm2pgrouting`` converter, which is a command line tool, so you need to open a terminal window.
+
+We take the default ``mapconfig.xml`` configuration file and the ``routing`` database we created before. Furthermore we take ``~/Desktop/pgrouting-workshop/data/sampledata.osm`` as raw data. This file contains only OSM data from downtown Denver to speed up  data processing time.
+
+The workshop data is available as compressed file, which needs to be extracted first either using file manager or with this command:
+
+.. code-block:: bash
+
+	cd ~/Desktop/pgrouting-workshop/
+	tar -xvzf data.tar.gz
+
+Then run the converter:
+	
+.. code-block:: bash
+
+	osm2pgrouting -file "data/sampledata.osm" \
+				  -conf "/usr/share/osm2pgrouting/mapconfig.xml" \
+				  -dbname routing \
+				  -user postgres \
+				  -clean
+					
+List of all possible parameters:
+
+.. list-table::
+   :widths: 15 15 60 10
+
+   * - **Parameter**
+     - **Value**
+     - **Description**
+     - **Required**
+   * - -file
+     - <file>
+     - name of your osm xml file
+     - yes
+   * - -dbname
+     - <dbname>
+     - name of your database
+     - yes
+   * - -user
+     - <user>
+     - name of the user, which have write access to the database
+     - yes
+   * - -conf
+     - <file>
+     - name of your configuration xml file
+     - yes
+   * - -host
+     - <host>
+     - host of your postgresql database (default: 127.0.0.1)
+     - no
+   * - -port
+     - <port>
+     - port of your database (default: 5432)
+     - no
+   * - -passwd
+     - <passwd>
+     - password for database access
+     - no
+   * - -clean
+     - 
+     - drop peviously created tables
+     - no
+
+.. note::
+
+	If you get permission denied error for postgres users you can set connection method to ``trust`` in ``/etc/postgresql/8.4/main/pg_hba.conf`` and restart PostgreSQL server with ``sudo service postgresql-8.4 restart``.
+
+
+Depending on the size of your network the calculation and import may take a while. After it's finished connect to your database and check the tables that should have been created:
+
+.. rubric:: Run: ``psql -U postgres -d routing -c "\d"``	
+
+If everything went well the result should look like this:
+	
+.. code-block:: sql
+
+		             List of relations
+	 Schema |        Name         |   Type   |  Owner   
+	--------+---------------------+----------+----------
+	 public | classes             | table    | postgres
+	 public | geometry_columns    | table    | postgres
+	 public | nodes               | table    | postgres
+	 public | spatial_ref_sys     | table    | postgres
+	 public | types               | table    | postgres
+	 public | vertices_tmp        | table    | postgres
+	 public | vertices_tmp_id_seq | sequence | postgres
+	 public | ways                | table    | postgres
+	(8 rows)
+
+	
+
Index: /trunk/workshop-routing-foss4g/chapters/installation.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/installation.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/installation.rst	(revision 63)
@@ -0,0 +1,181 @@
+==============================================================================================================
+Installation et prÃ©-requis
+==============================================================================================================
+
+Pour ces travaux pratiques, vous aurez besoin de :
+
+* un serveur wev comme Apache avec le support PHP d'activÃ© (et le module PostgreSQL de PHP)
+* De prÃ©fÃ©rence un systÃšme d'exploitation de type Linux comme Ubuntu
+* Un Ã©diteur de texte comme Gedit
+* Une connexion internet
+
+Tout les outils requis sont disponibles sur l'OSGeo LiveDVD, donc les rÃ©fÃ©rences qui suivent reprÃ©sentent un rapide rÃ©sumÃ© de comment l'installer sur votre propre machine tournant sur Ubuntu 10.04 ou suppÃ©rieur.
+
+--------------------------------------------------------------------------------------------------------------
+pgRouting
+--------------------------------------------------------------------------------------------------------------
+
+L'installation de pgRouting sur Ubuntu est devenu extrÃªmement simple du fait de la disponibilitÃ© d'un paquet binaire dans le `dÃ©pot Launchpad <https://launchpad.net/~georepublic/+archive/pgrouting>`_: . 
+
+Tout ce que vous avez Ã  faire maintenant c'est d'ouvrir un fenÃªtre de terminal et de lancer :
+
+.. code-block:: bash
+	
+	# Ajouter le dÃ©pÃŽt launchpad
+	sudo add-apt-repository ppa:georepublic/pgrouting
+	sudo apt-get update
+
+	# Installer les paquets pgRouting
+	sudo apt-get install gaul-devel \
+		postgresql-8.4-pgrouting \
+		postgresql-8.4-pgrouting-dd \
+		postgresql-8.4-pgrouting-tsp
+
+	# Installer le paquet osm2pgrouting
+	sudo apt-get install osm2pgrouting
+
+	# InstallÃ© le contenu des travaux pratiques (optionel)
+	sudo apt-get install pgrouting-workshop
+
+Cela installera aussi tout les paquets dÃ©pendants comme PostgreSQL et PostGIS s'ils ne sont pas dÃ©jÃ  installÃ©.
+
+.. note::
+
+	* Les paquets "multiverse" doivent Ãªtre disponible comme des sourecs de logiciels. Actuellement les paquets pour Ubuntu 10.04 Ã  11.04 sont disponibles.
+	* Pour prendre en compte les nouveaux dÃ©pÃŽts et avoir une liste des tout deniers paquets Ã  jour, vous devez lancer ``sudo apt-get update & sudo apt-get upgrade`` de temps en temps, tout spÃ©cialement si vous utilisez une ancienne version du LiveDVD.
+	* Afin d'Ã©viter les problÃšmes de permissions, vous pouvez utiliser la mÃ©thode de connexion ``trust`` dans ``/etc/postgresql/8.4/main/pg_hba.conf`` et redÃ©marrer le serveur PostgreSQL avec ``sudo service postgresql-8.4 restart``.
+	
+--------------------------------------------------------------------------------------------------------------
+Travaux pratiques
+--------------------------------------------------------------------------------------------------------------
+
+Suite Ã  l'installation du paquet workshop, vous touverez tout les documents dans ``/usr/share/pgrouting/workshop/``.
+
+Nous recommendons de copier l'ensemble de ces fichiers dans le rÃ©pertoire de votre utilisateur et de crÃ©er un lient symbolique vers votre serveur web :
+
+.. code-block:: bash
+	
+	cp -R /usr/share/pgrouting/workshop ~/Desktop/pgrouting-workshop
+	sudo ln -s ~/Desktop/pgrouting-workshop /var/www/pgrouting-workshop
+
+Vous pouvez ensuite trouver les fichiers des travaux pratiques dans le rÃ©pertoire ``pgrouting-workshop`` et y accÃ©der :
+
+* RÃ©pertoire Web : http://localhost/pgrouting-workshop/web/
+* Manuel en ligne : http://localhost/pgrouting-workshop/docs/html/
+
+.. note::
+
+	Des exemple de donnÃ©es additionelles sont disponibles dans le rÃ©pertoire ``data`` des travaux pratique. Ils contiennent un fichier compressÃ© contenant les sauvegardes de base de donnÃ©es ainsi qu'un plus petit ensemble de donnÃ©es du rÃ©seau routier du centre ville de Denver. Pour dÃ©compresser ce fichier, exÃ©cuter la commande ``tar -xzf ~/Desktop/pgrouting-workshop/data.tar.gz``.
+
+
+--------------------------------------------------------------------------------------------------------------
+Base de donnÃ©es Ã  partir de modÃšle
+--------------------------------------------------------------------------------------------------------------
+
+C'est une bonne idÃ©e de crÃ©er un modÃšle de bases de donnÃ©es PostGIS et pgRouting. Cela rendra plus facile la crÃ©ation de nouvelles bases de donnÃ©es incluant dÃ©jÃ  les fonctionnalitÃ©s requises, sans avoir Ã  charger les fichiers SQL pour chaque nouvelle base.
+
+Un script est disponible dans le rÃ©pertoire ``bin`` des travaux pratiques pour ajouter des modÃšles de bases de donnÃ©es incluant les fonctionnalitÃ©s de PostGIS et pgRouting. Pour crÃ©er une base de donnÃ©es modÃšles, exÃ©cutez les commandes suivantes depuis une fenÃªtre de terminal :
+
+.. code-block:: bash
+	
+	cd ~/Desktop/pgrouting-workshop
+	bash bin/create_templates.sh
+
+Maintenant vous pouvez crÃ©er une nouvelle base incluant les fonctionnalitÃ©s pgRouting en utilsant ``template_routing`` comme modÃšle. Lancez la commande suivante dans une fenÃªtr ede terminal :
+
+.. code-block:: bash
+	
+	# CrÃ©ation de la base de donnÃ©es "routing"
+	createdb -U postgres -T template_routing routing
+
+Vous povez aussi utiliser **PgAdmin III** et des commandes SQL. DÃ©marrez PgAdmin III (disponible sur le LiveDVD), connectez-vous Ã  n'importe quelle base de donnÃ©es et ouvrez l'Ã©diteur SQL afin de lancer les commandes SQL suivantes :
+
+.. code-block:: sql
+
+	-- CrÃ©ation de la base routing
+	CREATE DATABASE "routing" TEMPLATE "template_routing";
+
+
+.. _installation_load_functions:
+
+--------------------------------------------------------------------------------------------------------------
+Chargement des functions
+--------------------------------------------------------------------------------------------------------------
+
+Sans une base de donnÃ©es modÃšle, de nombreux fichiers contenant les fonctions de pgRouting doivent Ãªtre chargÃ©s dans la base. Pour procÃ©der de la sorte, utilsez les commandes suivantes depuis une fenÃªtre de terminal :
+
+.. code-block:: bash
+
+	# Passer en utilisateur "postgres" (ou lancez, en tant qu'utilisateur "postgres")
+	sudo su postgres
+
+	# CrÃ©ation d'un base routing
+	createdb routing
+	createlang plpgsql routing
+
+	# Ajouter les fonctions PostGIS
+	psql -d routing -f /usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql
+	psql -d routing -f /usr/share/postgresql/8.4/contrib/postgis-1.5/spatial_ref_sys.sql
+
+	# Ajouter les fonctions de base de pgRouting
+	psql -d routing -f /usr/share/postlbs/routing_core.sql
+	psql -d routing -f /usr/share/postlbs/routing_core_wrappers.sql
+	psql -d routing -f /usr/share/postlbs/routing_topology.sql
+	
+Encore un fois, vous pouvez utiliser **PgAdmin III** et des commandes SQL. DÃ©marrez PgAdmin III, connextez-vous Ã  n'importe quelle base de donnÃ©es, ouvrez l'Ã©diteur de commande SQL et saisissez les commandes suivantes :
+
+.. code-block:: sql
+
+	-- CrÃ©ation de la base routing
+	CREATE DATABASE "routing";
+	
+Connectez-vous ensuite Ã  la base ``routing`` et ouvrez une nouvelle fenÃªtre d'Ã©diteur SQL :
+	
+.. code-block:: sql
+
+	-- Ajouter le support plpgsql et les fonctions PostGIS/pgRouting
+	CREATE PROCEDURAL LANGUAGE plpgsql;
+
+Maintenant, ouvrez les fichiers ``.sql`` contenant les fonctions PostGIS/pgRouting listÃ©e prÃ©cÃ©demment et chargez les dans la base de donnÃ©es ``routing``.
+	
+.. note::
+
+	PostGIS ``.sql`` files can be stored in different directories. The exact location depends on your version of PostGIS and PostgreSQL. The example above is valid for PostgeSQL/PostGIS version 1.5 installed on OSGeo LiveDVD.
+	
+
+--------------------------------------------------------------------------------------------------------------
+DonnÃ©es
+--------------------------------------------------------------------------------------------------------------
+
+Les travaux pratiques pgRouting utiliseront les donnÃ©es de Denver d'OpenStreetMap, quisont dÃ©jÃ  disponibles sur le LiveDVD. Si vous n'utilisez pas le LiveDV ou si vous voulez tÃ©lÃ©charger les derniÃšres donnÃ©es ou des donnÃ©es de votre choix, vous pouvez utiliser l'API OpenStreetMap depuis votre fenÃªtre de terminal :
+
+.. code-block:: bash
+	
+	# TÃ©lÃ©charger le fichier sampledata.osm
+	wget --progress=dot:mega -O "sampledata.osm"  
+		"http://jxapi.openstreetmap.org/xapi/api/0.6/*
+						[bbox=-105.2147,39.5506,-104.594,39.9139]"
+
+L'API a une limite de taille de tÃ©lÃ©chargment, ce qui peut Ãªtre problÃ©matique pour tÃ©lÃ©charger une grande Ã©tendu gÃ©ographique avec de nombreux Ã©lÃ©ments. Une alternative est d'utiliser  `l'Ã©diteur JOSM <http://josm.openstreetmap.de>`_, qui utilisera aussi des appels Ã  l'API pour tÃ©lÃ©charger les donnÃ©es, mais il fournit un interface facile d'utilisation pour les utilisateurs. Vous pouvez sauvegarder les donnÃ©es come un fichier ``.osm`` pour l'utiliser avec ces travaux pratiques. JSOM est aussi disponible sur le LiveDVD.
+
+.. note::
+
+	* OpenStreetMap API v0.6, voir pour plus d'informations http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.6
+	* Les donnÃ©es de Denver sont disponibles sur le LiveDVD dans le rÃ©pertoire ``/usr/local/share/osm/``
+
+Une alternative, pour de trÃšs grandes Ã©tendues est d'utiliser le service de tÃ©lÃ©chargement de `CloudMade <http://www.cloudemade.com>`_. Cette entreprise offre des extractions de cartes pour tous les pays du monde. Pour les donnÃ©es du Colorado par exemple, allez sur le page http://download.cloudmade.com/americas/northern_america/united_states/colorado et tÃ©lÃ©chargez le fichier compressÃ© ``.osm.bz2`` :
+
+.. code-block:: bash
+
+	wget --progress=dot:mega http://download.cloudmade.com/americas/northern_america/united_states/colorado/colorado.osm.bz2
+	
+.. warning::
+
+	Les donnÃ©es d'un pays complet peuvent Ãªtre trop grande par rapport Ã  l'espace disponible sur le LiveDVD et nÃ©cessitÃ© des temps de calculs extrÃªmement long.  
+	
+
+
+
+
+
+
Index: /trunk/workshop-routing-foss4g/chapters/introduction.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/introduction.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/introduction.rst	(revision 63)
@@ -0,0 +1,49 @@
+==============================================================================================================
+Introduction
+==============================================================================================================
+
+.. rubric:: Abstract
+
+`pgRouting <http://www.pgrouting.org>`_ ajoute les fonctionalitÃ© de routage Ã  `PostGIS <http://www.postgis.org>`_. Ces travaux pratiques d'introduction va vous prÃ©senter comment. Il prÃ©sente un exemple pratique de comment utiliser pgRouting avec les donnÃ©es du rÃ©seau routier d'`OpenStreetMap <http://www.openstreetmap.org>`_. Il explique les Ã©tapes permettant la prÃ©paration des donnÃ©es, effectuer des requÃªtes de routage, l'assignation des coÃ»ts et l'utilisation de `GeoExt <http://www.geoext.org>`_ pour prÃ©senter les chamins depuis une application de web-mapping.
+
+La navigration dans un rÃ©seau de routes nÃ©cessite des algorithmes de routage complex qui supportent la restriction des virages utilisables et mÃªme des attributs dÃ©pendant du temps. pgRouting est une librairie OpenSource qui peut Ãªtre Ã©tendue qui fournit une grande variÃ©tÃ© d'outils pour la recherche de plus courts chemins comme une extension de PortgreSQL et de PostGIS. Ces travaux pratiques vont expliquer la recherche de plus courts chemin avec pgRouting dans un rÃ©seau routier rÃ©el et comment la structure des donnÃ©es est importante pour obtenir des rÃ©sultats plus rapidement. Vous apprendrez aussi les difficultÃ©s et le limitations de pgRouting dans le cadre d'application SIG.
+
+Pour fournir un exemple pratique, ces travaux pratiques utiliseront les donnÃ©es OpenStreetMap de Denver. Vous apprendrez comment convertir les donnÃ©es dans le format requis et comment calibrer les donnÃ©es avec les attributs de "coÃ»t". De plus, nuos allons expliquer la diffÃ©rence entre l'agorithme principal de routage "Dijkstra", "A-Star" et "Shooting-Star". Ã la fin de ces travaux ratiques vous aurez acquis une bonne comprÃ©hension de comment utiliser pgRouting et comment prÃ©parer vos donnÃ©es de rÃ©seau.
+
+Pour apprendre comment utiliser la liste des rÃ©sultats afin de les affichÃ©es sur une carte, nous allons contruire une interface graphique de base avec GeoExt. Nous avons Ã©coutÃ© les remarques qui avaient Ã©tÃ© faites l'an dernier et voulons vous guider pour les Ã©tapes de bases nÃ©cessaires Ã  la mise en ligne d'une application de routage. Notre but est de faire cei de la maniÃšres la plus simple possible, et de montrer qu'il n'est pas difficile d'intÃ©grer cela avec les autres outils OpenSource FOSS4G. Pour cette raison, nuos avons selectionnÃ© GeoExt, qui est une librairies JavaScript fournissant les Ã©lÃ©ments de base pour crÃ©er des application de web-mappping basÃ©es sur OpenLayers et Ext.
+
+.. note::
+
+	* Niveau requis : intermÃ©diaire
+	* Connaissances requises : SQL (PostgreSQL, PostGIS), Javascript, HTML
+	* MatÃ©riel : ces travaux pratiques utiliseront le LiveDVD de l'OSGeo.
+
+
+.. rubric:: Presenter
+
+* *Daniel Kastl* est le fondateur et le directeur de l'entreprise `Georepublic <http://georepublic.de>`_ et travail en Alemagne et au Japon. Il modÃšre et pormeut la communautÃ© pgRouting et en assure le dÃ©veloppement depuis 5 ans, il est un actif contributeur de la communautÃ© OSM au Japon.
+
+* *FrÃ©dÃ©ric Junod* travail au bureau Suisse de l'entreprise `Camptocamp <http://www.camptocamp.com>`_ depuis environ 5 ans. Il est dÃ©veloppeur actif de nombreux projets OpenSource depuis le navigateur (GeoExt, OpenLayers) jusqu'au monde serveur (MapFish, Shapely, TileCache) il est membre du commitÃ© de pilotage de pgRouting.
+
+Daniel et FrÃ©dÃ©ric sont les auteurs des travaxu pratiques pgRouting prÃ©cÃ©dents, qui ont eut lieu au FOSS4G au Canada, en Afrique du Sud, en Espagne et dans des confÃ©rences locales au Japon.
+
+.. rubric:: License
+
+Ce travail est ditribuÃ© sous licence `Creative Commons Attribution-Share Alike 3.0 License <http://creativecommons.org/licenses/by-sa/3.0/>`_.
+
+.. image:: images/license.png
+
+
+.. rubric:: Support
+
+.. image:: images/camptocamp.png
+	:alt: Camptocamp
+
+`Camptocamp <http://www.camptocamp.com>`_
+
+.. image:: images/georepublic.png
+	:alt: Georepublic
+	
+`Georepublic <http://georepublic.de>`_
+
+
Index: /trunk/workshop-routing-foss4g/chapters/code/mapconfig_sample.xml
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/code/mapconfig_sample.xml	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/code/mapconfig_sample.xml	(revision 63)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+  <type name="highway" id="1">
+    <class name="motorway" id="101" />
+    <class name="motorway_link" id="102" />
+    <class name="motorway_junction" id="103" />
+    ...
+    <class name="road" id="100" />
+  </type>    
+  <type name="junction" id="4">
+    <class name="roundabout" id="401" />
+  </type>  
+</configuration> 
Index: /trunk/workshop-routing-foss4g/chapters/code/osm_sample.osm
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/code/osm_sample.osm	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/code/osm_sample.osm	(revision 63)
@@ -0,0 +1,48 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version='0.6' generator='xapi: OSM Extended API 2.0' ... >
+  ...	
+  <node id='255405560' lat='41.4917468' lon='2.0257695' version='1' 
+  		changeset='19117' user='efrainlarrea' uid='32823' visible='true' 
+  		timestamp='2008-04-02T17:40:07Z'>
+  </node>
+  <node id='255405551' lat='41.4866740' lon='2.0302842' version='3' 
+  		changeset='248452' user='efrainlarrea' uid='32823' visible='true' 
+  		timestamp='2008-04-24T15:56:08Z'>
+  </node>
+  <node id='255405552' lat='41.4868540' lon='2.0297863' version='1' 
+  		changeset='19117' user='efrainlarrea' uid='32823' visible='true' 
+  		timestamp='2008-04-02T17:40:07Z'>
+  </node>
+  ...
+  <way id='35419222' visible='true' timestamp='2009-06-03T21:49:11Z' 
+  		version='1' changeset='1416898' user='Yodeima' uid='115931'>
+    <nd ref='415466914'/>
+    <nd ref='415466915'/>
+    <tag k='highway' v='unclassified'/>
+    <tag k='lanes' v='1'/>
+    <tag k='name' v='Carrer del ProgrÃ©s'/>
+    <tag k='oneway' v='no'/>
+  </way>
+  <way id='35419227' visible='true' timestamp='2009-06-14T20:37:55Z' 
+  		version='2' changeset='1518775' user='Yodeima' uid='115931'>
+    <nd ref='415472085'/>
+    <nd ref='415472086'/>
+    <nd ref='415472087'/>
+    <tag k='highway' v='unclassified'/>
+    <tag k='lanes' v='1'/>
+    <tag k='name' v='carrer de la mecanica'/>
+    <tag k='oneway' v='no'/>
+  </way>
+  ...
+  <relation id='903432' visible='true' timestamp='2010-05-06T08:36:54Z' 
+  		version='1' changeset='4619553' user='ivansanchez' uid='5265'>
+    <member type='way' ref='56426179' role='outer'/>
+    <member type='way' ref='56426173' role='inner'/>
+    <tag k='layer' v='0'/>
+    <tag k='leisure' v='common'/>
+    <tag k='name' v='PlaÃ§a Can Suris'/>
+    <tag k='source' v='WMS shagrat.icc.cat'/>
+    <tag k='type' v='multipolygon'/>
+  </relation>
+  ...
+</osm>
Index: /trunk/workshop-routing-foss4g/chapters/advanced.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/advanced.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/advanced.rst	(revision 63)
@@ -0,0 +1,143 @@
+==============================================================================================================
+Advanced Routing Queries
+==============================================================================================================
+
+As explained in the previous chapter a shortest path query usualy looks like this:
+
+.. code-block:: sql
+
+	SELECT * FROM shortest_path_shooting_star(
+		'SELECT gid as id, source, target, length as cost, x1, y1, x2, y2, rule, 
+		to_cost, reverse_cost FROM ways', 6585, 8247, true, true);
+	
+This is usually called **shortest** path, which means that a length of an edge is its cost. But cost doesn't need to be length, cost can be almost anything, for example time, slope, surface, road type, etc.. Or it can be a combination of multiple parameters ("Weighted costs").
+
+.. note::
+
+	If you want to proceed with a routing database containing pgRouting functions, sample data and all required attributes, you can load the following database dump file. 
+
+.. code-block:: bash
+
+	# Optional: Drop database
+	dropdb -U postgres pgrouting-workshop
+
+	# Load database dump file
+	psql -U postgres -f ~/Desktop/pgrouting-workshop/data/sampledata_routing.sql
+
+-------------------------------------------------------------------------------------------------------------
+Weighted costs
+-------------------------------------------------------------------------------------------------------------
+
+In real networks there are different limitations or preferences for different road types for example. In other words, we don't want to get the *shortest* but the **cheapest** path - a path with a minimal cost. There is no limitation in what we take as costs.
+
+When we convert data from OSM format using the osm2pgrouting tool, we get two additional tables for road ``types`` and road ``classes``:
+
+.. note::
+
+	We switch now to the database we previously generated with osm2pgrouting. From within PostgreSQL shell this is possible with the ``\c routing`` command.
+
+.. rubric:: Run: ``SELECT * FROM types;``
+
+.. code-block:: sql
+
+	  id |   name    
+	-----+------------
+	   2 | cycleway
+	   1 | highway
+	   4 | junction
+	   3 | tracktype
+   
+.. rubric:: Run: ``SELECT * FROM classes;``
+
+.. code-block:: sql
+
+	 id  | type_id |        name        |  cost 
+	-----+---------+--------------------+--------
+	 201 |       2 | lane               |     
+	 204 |       2 | opposite           |     
+	 203 |       2 | opposite_lane      |    
+	 202 |       2 | track              |     
+	 117 |       1 | bridleway          |     
+	 113 |       1 | bus_guideway       |     
+	 118 |       1 | byway              |     
+	 115 |       1 | cicleway           |     
+	 116 |       1 | footway            |     
+	 108 |       1 | living_street      |     
+	 101 |       1 | motorway           |    
+	 103 |       1 | motorway_junction  |     
+	 102 |       1 | motorway_link      |     
+	 114 |       1 | path               |     
+	 111 |       1 | pedestrian         |     
+	 106 |       1 | primary            |     
+	 107 |       1 | primary_link       |     
+	 107 |       1 | residential        |     
+	 100 |       1 | road               |     
+	 100 |       1 | unclassified       |     
+	 106 |       1 | secondary          |    
+	 109 |       1 | service            |     
+	 112 |       1 | services           |     
+	 119 |       1 | steps              |     
+	 107 |       1 | tertiary           |     
+	 110 |       1 | track              |     
+	 104 |       1 | trunk              |     
+	 105 |       1 | trunk_link         |     
+	 401 |       4 | roundabout         |     
+	 301 |       3 | grade1             |     
+	 302 |       3 | grade2             |     
+	 303 |       3 | grade3             |     
+	 304 |       3 | grade4             |     
+	 305 |       3 | grade5             |     
+
+The road class is linked with the ways table by ``class_id`` field. After importing data the ``cost`` attribute is not set yet. Its values can be changed with an ``UPDATE`` query. In this example cost values for the classes table are assigned arbitrary, so we execute:
+
+.. code-block:: sql
+
+	UPDATE classes SET cost=1 ;
+	UPDATE classes SET cost=2.0 WHERE name IN ('pedestrian','steps','footway');
+	UPDATE classes SET cost=1.5 WHERE name IN ('cicleway','living_street','path');
+	UPDATE classes SET cost=0.8 WHERE name IN ('secondary','tertiary');
+	UPDATE classes SET cost=0.6 WHERE name IN ('primary','primary_link');
+	UPDATE classes SET cost=0.4 WHERE name IN ('trunk','trunk_link');
+	UPDATE classes SET cost=0.3 WHERE name IN ('motorway','motorway_junction','motorway_link');
+
+For better performance, especially if the network data is large, it is better to create an index on the ``class_id`` field of the ways table and eventually on the ``id`` field of the ``types`` table.
+
+.. code-block:: sql
+
+	CREATE INDEX ways_class_idx ON ways (class_id);
+	CREATE INDEX classes_idx ON classes (id);
+
+The idea behind these two tables is to specify a factor to be multiplied with the cost of each link (usually length):
+
+.. code-block:: sql
+
+	SELECT * FROM shortest_path_shooting_star(
+		'SELECT gid as id, class_id, source, target, length*c.cost as cost, 
+			x1, y1, x2, y2, rule, to_cost, reverse_cost*c.cost as reverse_cost 
+		FROM ways w, classes c 
+		WHERE class_id=c.id', 6585, 8247, true, true);
+
+-------------------------------------------------------------------------------------------------------------
+Restricted access
+-------------------------------------------------------------------------------------------------------------
+
+Another possibility is to restrict access to roads of a certain type by either setting a very high cost for road links with a certain attribute or by not selecting certain road links at all:
+
+.. code-block:: sql
+
+	UPDATE classes SET cost=100000 WHERE name LIKE 'motorway%';
+
+Through subqueries you can "mix" your costs as you like and this will change the results of your routing request immediately. Cost changes will affect the next shortest path search, and there is no need to rebuild your network.
+
+Of course certain road classes can be excluded in the ``WHERE`` clause of the query as well, for example exclude "living_street" class:
+
+.. code-block:: sql
+
+	SELECT * FROM shortest_path_shooting_star(
+		'SELECT gid as id, class_id, source, target, length*c.cost as cost, 
+			x1, y1, x2, y2, rule, to_cost, reverse_cost*c.cost as reverse_cost 
+		FROM ways w, classes c 
+		WHERE class_id=c.id AND class_id != 111', 6585, 8247, true, true);
+
+Of course pgRouting allows you all kind of SQL that is possible with PostgreSQL/PostGIS.
+ 
Index: /trunk/workshop-routing-foss4g/chapters/shortest_path.rst
===================================================================
--- /trunk/workshop-routing-foss4g/chapters/shortest_path.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/chapters/shortest_path.rst	(revision 63)
@@ -0,0 +1,382 @@
+==============================================================================================================
+Shortest Path Search
+==============================================================================================================
+
+pgRouting was first called *pgDijkstra*, because it implemented only shortest path search with *Dijkstra* algorithm. Later other functions were added and the library was renamed.
+
+.. image:: images/route.png
+	:width: 250pt
+	:align: center
+	
+This chapter will explain the three different shortest path algorithms and which attributes are required. 
+
+
+.. note::
+
+	If you run :doc:`osm2pgrouting <osm2pgrouting>` tool to import *OpenStreetMap* data, the ``ways`` table contains all attributes already to run all shortest path functions. The ``ways`` table of the ``pgrouting-workshop`` database of the :doc:`previous chapter <topology>` is missing several attributes instead, which are listed as **Prerequisites** in this chapter.
+
+
+-------------------------------------------------------------------------------------------------------------
+Dijkstra
+-------------------------------------------------------------------------------------------------------------
+
+Dijkstra algorithm was the first algorithm implemented in pgRouting. It doesn't require other attributes than ``source`` and ``target`` ID, ``id`` attribute and ``cost``. It can distinguish between directed and undirected graphs. You can specify if your network has ``reverse cost`` or not.
+
+.. rubric:: Prerequisites
+
+To be able to use ``reverse cost`` you need to add an additional cost column. We can set reverse cost as length.
+
+.. code-block:: sql
+
+	ALTER TABLE ways ADD COLUMN reverse_cost double precision;
+	UPDATE ways SET reverse_cost = length;
+
+.. rubric:: Function with parameters
+
+.. code-block:: sql
+
+	shortest_path( sql text, 
+			   source_id integer, 
+			   target_id integer, 
+			   directed boolean, 
+			   has_reverse_cost boolean ) 
+
+.. note::
+
+	* Source and target IDs are vertex IDs.
+	* Undirected graphs ("directed false") ignore "has_reverse_cost" setting
+
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Each algorithm has its *core* function , which is the base for its wrapper functions.
+
+.. code-block:: sql
+
+	SELECT * FROM shortest_path('
+			SELECT gid as id, 
+				 source::integer, 
+				 target::integer, 
+				 length::double precision as cost 
+				FROM ways', 
+			5700, 6733, false, false); 
+
+.. code-block:: sql
+
+	 vertex_id | edge_id |        cost         
+	-----------+---------+---------------------
+	      5700 |    6585 |   0.175725539559539
+	      5701 |   18947 |   0.178145491343884
+	      2633 |   18948 |   0.177501253416424
+	       ... |     ... |                 ...
+	      6733 |      -1 |                   0
+	 (38 rows)
+
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Wrapper
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. rubric:: Wrapper WITHOUT bounding box
+
+Wrapper functions extend the core functions with transformations, bounding box limitations, etc.. Wrappers can change the format and ordering of the result. They often set default function parameters and make the usage of pgRouting more simple.
+
+.. code-block:: sql
+
+	SELECT gid, AsText(the_geom) AS the_geom 
+		FROM dijkstra_sp('ways', 5700, 6733);
+		
+.. code-block:: sql
+		
+	  gid   |                              the_geom      
+	--------+---------------------------------------------------------------
+	   5534 | MULTILINESTRING((-104.9993415 39.7423284, ... ,-104.9999815 39.7444843))
+	   5535 | MULTILINESTRING((-104.9999815 39.7444843, ... ,-105.0001355 39.7457581))
+	   5536 | MULTILINESTRING((-105.0001355 39.7457581,-105.0002133 39.7459024))
+	    ... | ...
+	  19914 | MULTILINESTRING((-104.9981408 39.7320938,-104.9981194 39.7305074))
+	(37 rows)
+
+
+.. note::
+
+	It's possible to show the route in QGIS. It works for shortest path queries that return a geometry column.
+
+	* Create a database connection and add the "ways" table as a background layer.
+	* Add another layer of the "ways" table but select ``Build query`` before adding it.
+	* Type ``"gid"  IN ( SELECT gid FROM dijkstra_sp('ways',5700,6733))`` into the **SQL where clause** field.
+	
+	``SQL query`` can be also selected from the layer context menu. 
+
+	
+.. rubric:: Wrapper WITH bounding box
+
+You can limit your search area by adding a bounding box. This will improve performance especially for large networks.
+
+.. code-block:: sql
+
+	SELECT gid, AsText(the_geom) AS the_geom 
+		FROM dijkstra_sp_delta('ways', 5700, 6733, 0.1);
+		
+.. code-block:: sql
+
+	  gid   |                              the_geom      
+	--------+---------------------------------------------------------------
+	   5534 | MULTILINESTRING((-104.9993415 39.7423284, ... ,-104.9999815 39.7444843))
+	   5535 | MULTILINESTRING((-104.9999815 39.7444843, ... ,-105.0001355 39.7457581))
+	   5536 | MULTILINESTRING((-105.0001355 39.7457581,-105.0002133 39.7459024))
+	    ... | ...
+	  19914 | MULTILINESTRING((-104.9981408 39.7320938,-104.9981194 39.7305074))
+	(37 rows)
+
+.. note:: 
+
+	The projection of OSM data is "degree", so we set a bounding box containing start and end vertex plus a ``0.1`` degree buffer for example.
+
+
+-------------------------------------------------------------------------------------------------------------
+A-Star
+-------------------------------------------------------------------------------------------------------------
+
+A-Star algorithm is another well-known routing algorithm. It adds geographical information to source and target of each network link. This enables the shortest path search to prefer links which are closer to the target of the search.
+
+.. rubric:: Prerequisites
+
+For A-Star you need to prepare your network table and add latitute/longitude columns (``x1``, ``y1`` and ``x2``, ``y2``) and calculate their values.
+
+.. code-block:: sql
+
+	ALTER TABLE ways ADD COLUMN x1 double precision;
+	ALTER TABLE ways ADD COLUMN y1 double precision;
+	ALTER TABLE ways ADD COLUMN x2 double precision;
+	ALTER TABLE ways ADD COLUMN y2 double precision;
+	
+	UPDATE ways SET x1 = x(ST_startpoint(the_geom));
+	UPDATE ways SET y1 = y(ST_startpoint(the_geom));
+	
+	UPDATE ways SET x2 = x(ST_endpoint(the_geom));
+	UPDATE ways SET y2 = y(ST_endpoint(the_geom));
+	
+	UPDATE ways SET x1 = x(ST_PointN(the_geom, 1));
+	UPDATE ways SET y1 = y(ST_PointN(the_geom, 1));
+	
+	UPDATE ways SET x2 = x(ST_PointN(the_geom, ST_NumPoints(the_geom)));
+	UPDATE ways SET y2 = y(ST_PointN(the_geom, ST_NumPoints(the_geom)));
+
+.. Note:: 
+
+	``endpoint()`` function fails for some versions of PostgreSQL (ie. 8.2.5, 8.1.9). A workaround for that problem is using the ``PointN()`` function instead:
+
+
+.. rubric:: Function with parameters
+
+Shortest Path A-Star function is very similar to the Dijkstra function, though it prefers links that are close to the target of the search. The heuristics of this search are predefined, so you need to recompile pgRouting if you want to make changes to the heuristic function itself.
+
+.. code-block:: sql
+
+	shortest_path_astar( sql text, 
+			   source_id integer, 
+			   target_id integer, 
+			   directed boolean, 
+			   has_reverse_cost boolean ) 
+
+.. note::
+	* Source and target IDs are vertex IDs.
+	* Undirected graphs ("directed false") ignore "has_reverse_cost" setting
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: sql
+
+	SELECT * FROM shortest_path_astar('
+			SELECT gid as id, 
+				 source::integer, 
+				 target::integer, 
+				 length::double precision as cost, 
+				 x1, y1, x2, y2
+				FROM ways', 
+			5700, 6733, false, false); 
+		
+.. code-block:: sql
+		
+	 vertex_id | edge_id |        cost         
+	-----------+---------+---------------------
+	      5700 |    6585 |   0.175725539559539
+	      5701 |   18947 |   0.178145491343884
+	      2633 |   18948 |   0.177501253416424
+	       ... |     ... |                 ...
+	      6733 |      -1 |                   0
+	 (38 rows)
+
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Wrapper
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. rubric:: Wrapper function WITH bounding box
+
+Wrapper functions extend the core functions with transformations, bounding box limitations, etc..
+
+.. code-block:: sql
+
+	SELECT gid, AsText(the_geom) AS the_geom 
+		FROM astar_sp_delta('ways', 5700, 6733, 0.1);
+
+.. code-block:: sql
+
+	  gid   |                              the_geom      
+	--------+---------------------------------------------------------------
+	   5534 | MULTILINESTRING((-104.9993415 39.7423284, ... ,-104.9999815 39.7444843))
+	   5535 | MULTILINESTRING((-104.9999815 39.7444843, ... ,-105.0001355 39.7457581))
+	   5536 | MULTILINESTRING((-105.0001355 39.7457581,-105.0002133 39.7459024))
+	    ... | ...
+	  19914 | MULTILINESTRING((-104.9981408 39.7320938,-104.9981194 39.7305074))
+	(37 rows)
+
+	
+.. note::
+
+	* There is currently no wrapper function for A-Star without bounding box, since bounding boxes are very useful to increase performance. If you don't need a bounding box Dijkstra will be enough anyway.
+	* The projection of OSM data is "degree", so we set a bounding box containing start and end vertex plus a 0.1 degree buffer for example.
+
+
+-------------------------------------------------------------------------------------------------------------
+Shooting-Star
+-------------------------------------------------------------------------------------------------------------
+
+Shooting-Star algorithm is the latest of pgRouting shortest path algorithms. Its speciality is that it routes from link to link, not from vertex to vertex as Dijkstra and A-Star algorithms do. This makes it possible to define relations between links for example, and it solves some other vertex-based algorithm issues like "parallel links", which have same source and target but different costs.
+
+.. rubric:: Prerequisites
+
+For Shooting-Star you need to prepare your network table and add the ``rule`` and ``to_cost`` column. Like A-Star this algorithm also has a heuristic function, which prefers links closer to the target of the search.
+
+.. code-block:: sql
+
+	-- Add rule and to_cost column
+	ALTER TABLE ways ADD COLUMN to_cost double precision;	
+	ALTER TABLE ways ADD COLUMN rule text;
+
+.. rubric:: Shooting-Star algorithm introduces two new attributes
+
+.. list-table::
+   :widths: 10 90
+
+   * - **Attribute**
+     - **Description**
+   * - rule
+     - a string with a comma separated list of edge IDs, which describes a rule for turning restriction (if you came along these edges, you can pass through the current one only with the cost stated in to_cost column)
+   * - to_cost
+     - a cost of a restricted passage (can be very high in a case of turn restriction or comparable with an edge cost in a case of traffic light)
+
+.. rubric:: Function with parameters
+
+.. code-block:: sql
+
+	shortest_path_shooting_star( sql text, 
+			   source_id integer, 
+			   target_id integer, 
+			   directed boolean, 
+			   has_reverse_cost boolean ) 
+
+.. note::
+
+	* Source and target IDs are link IDs.
+	* Undirected graphs ("directed false") ignores "has_reverse_cost" setting
+
+To describe turn restrictions:
+
+.. code-block:: sql
+
+	 gid | source | target | cost | x1 | y1 | x2 | y2 | to_cost | rule
+	-----+--------+--------+------+----+----+----+----+---------+------
+	  12 |      3 |     10 |    2 |  4 |  3 |  4 |  5 |    1000 | 14
+  
+... means that the cost of going from edge 14 to edge 12 is 1000, and
+
+.. code-block:: sql
+
+	 gid | source | target | cost | x1 | y1 | x2 | y2 | to_cost | rule
+	-----+--------+--------+------+----+----+----+----+---------+------
+	  12 |      3 |     10 |    2 |  4 |  3 |  4 |  5 |    1000 | 14, 4
+
+... means that the cost of going from edge 14 to edge 12 through edge 4 is 1000.
+
+If you need multiple restrictions for a given edge then you have to add multiple records for that edge each with a separate restriction.
+
+.. code-block:: sql
+
+	 gid | source | target | cost | x1 | y1 | x2 | y2 | to_cost | rule
+	-----+--------+--------+------+----+----+----+----+---------+------
+	  11 |      3 |     10 |    2 |  4 |  3 |  4 |  5 |    1000 | 4
+	  11 |      3 |     10 |    2 |  4 |  3 |  4 |  5 |    1000 | 12
+
+... means that the cost of going from either edge 4 or 12 to edge 11 is 1000. And then you always need to order your data by gid when you load it to a shortest path function..
+
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+An example of a Shooting Star query may look like this: 
+
+.. code-block:: sql
+
+	SELECT * FROM shortest_path_shooting_star('
+			SELECT gid as id, 
+				 source::integer,
+				 target::integer, 
+				 length::double precision as cost, 
+				 x1, y1, x2, y2,
+				 rule, to_cost 
+				FROM ways', 
+			6585, 8247, false, false); 
+
+.. code-block:: sql
+
+	 vertex_id | edge_id |        cost
+	-----------+---------+---------------------
+	     15007 |    6585 |   0.175725539559539
+	     15009 |   18947 |   0.178145491343884
+	      9254 |   18948 |   0.177501253416424
+	       ... |     ... |   ...
+	      1161 |    8247 |   0.051155648874288
+	 (37 rows)
+
+.. warning::
+
+	Shooting Star algorithm calculates a path from edge to edge (not from vertex to vertex). Column vertex_id contains start vertex of an edge from column edge_id.
+
+
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Wrapper
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Wrapper functions extend the core functions with transformations, bounding box limitations, etc..
+
+.. code-block:: sql
+
+	SELECT gid, AsText(the_geom) AS the_geom
+		FROM shootingstar_sp('ways', 6585, 8247, 0.1, 'length', true, true);
+
+.. code-block:: sql
+
+	  gid   |                              the_geom      
+	--------+---------------------------------------------------------------
+	   6585 | MULTILINESTRING((-104.9975345 39.7193508,-104.9975487 39.7209311))
+	  18947 | MULTILINESTRING((-104.9975487 39.7209311,-104.9975509 39.7225332))
+	  18948 | MULTILINESTRING((-104.9975509 39.7225332,-104.9975447 39.7241295))
+	    ... | ...
+	   8247 | MULTILINESTRING((-104.9978555 39.7495627,-104.9982781 39.7498884))
+	(37 rows)
+
+.. note::
+
+	There is currently no wrapper function for Shooting-Star without bounding box, since bounding boxes are very useful to increase performance. 
+
+.. warning::
+
+	The projection of OSM data is "degree", so we set a bounding box containing start and end vertex plus a 0.1 degree buffer for example.
Index: /trunk/workshop-routing-foss4g/conf.py
===================================================================
--- /trunk/workshop-routing-foss4g/conf.py	(revision 63)
+++ /trunk/workshop-routing-foss4g/conf.py	(revision 63)
@@ -0,0 +1,227 @@
+# -*- coding: utf-8 -*-
+#
+# Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt documentation build configuration file, created by
+# sphinx-quickstart on Sat Jul  3 21:23:22 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.append(os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.todo']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt'
+copyright = u'2010-2011 Daniel Kastl, FrÃ©dÃ©ric Junod'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '2011'
+# The full version, including alpha/beta/rc tags.
+release = '2'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+html_theme_options = {
+    #"rightsidebar": "true",
+    "stickysidebar": "true",
+    "footerbgcolor": "#FFEEFF",
+    "footertextcolor": "#555555",
+    "sidebarbgcolor": "#FFEEFF",
+    "sidebartextcolor": "#111111",
+    "sidebarlinkcolor": "#355F7C",
+    #"bgcolor": "",
+    #"textcolor": "",
+    #"linkcolor": "",
+    #"headbgcolor": "",
+    #"headtextcolor": "",
+    #"headlinkcolor": "",
+    #"codebgcolor": "",
+    #"codetextcolor": "",
+    #"bodyfont": "",
+    #"headfont": "",
+    #"relbartextcolor": "",
+    #"relbarlinkcolor": "",
+    "relbarbgcolor": "#555555"
+}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+html_title = "Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt"
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+html_short_title = "Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt"
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = "_static/pgrouting.png"
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+html_favicon = "_static/favicon.ico"
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+html_use_index = False
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+html_show_sourcelink = False
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'pgRoutingWorkshop'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+	'papersize'	: 'letter',
+	'pointsize'	: '10pt'
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('latex', 'pgRoutingWorkshop.tex', u'Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt Manual',
+   u'Daniel Kastl, FrÃ©dÃ©ric Junod', 'manual', False),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+latex_use_modindex = False
+
+# New in version 1.0
+latex_show_pagerefs = False
+latex_domain_indices = False
+
+
+# -- Custom Options --------------------------------------------------
+
+# Enable ToDo extension
+todo_include_todos = True
+
+html_show_sphinx = False
+
Index: /trunk/workshop-routing-foss4g/Makefile
===================================================================
--- /trunk/workshop-routing-foss4g/Makefile	(revision 63)
+++ /trunk/workshop-routing-foss4g/Makefile	(revision 63)
@@ -0,0 +1,89 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    = -Dlanguage=fr
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  dirhtml   to make HTML files named index.html in directories"
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  qthelp    to make HTML files and a qthelp project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Workshop-FOSS4GroutingwithpgRoutingtoolsOpenStreetMaproaddataandGeoExt.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Workshop-FOSS4GroutingwithpgRoutingtoolsOpenStreetMaproaddataandGeoExt.qhc"
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
Index: /trunk/workshop-routing-foss4g/README
===================================================================
--- /trunk/workshop-routing-foss4g/README	(revision 63)
+++ /trunk/workshop-routing-foss4g/README	(revision 63)
@@ -0,0 +1,20 @@
+# 
+# About:
+# =====
+# The docs directory contains the workshop documentation.
+# Sphinx installed on Ubuntu 10.04
+#
+
+# Install notes:
+# =============
+sudo apt-get install python-sphinx texlive-full
+sphinx-quickstart
+
+# Build Documentation:
+# ===================
+make html
+
+make latex
+cd _build/latex/
+make all-pdf
+
Index: /trunk/workshop-routing-foss4g/_templates/layout.html
===================================================================
--- /trunk/workshop-routing-foss4g/_templates/layout.html	(revision 63)
+++ /trunk/workshop-routing-foss4g/_templates/layout.html	(revision 63)
@@ -0,0 +1,15 @@
+<style>
+	.toctree-wrapper {
+		-webkit-column-count: 2;
+		-moz-column-count: 2;
+		column-count: 2;
+	}
+</style>
+
+{% extends "!layout.html" %}
+{% block sidebarsearch %}
+    {{ super() }}
+    <h3>License</h3>
+    <p style="font-size: 90%; margin-top:2px;">This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 License</a>.</p>
+    <p style="margin:0;"><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png"></a></p>
+{% endblock %}
Index: /trunk/workshop-routing-foss4g/checkout.sh
===================================================================
--- /trunk/workshop-routing-foss4g/checkout.sh	(revision 63)
+++ /trunk/workshop-routing-foss4g/checkout.sh	(revision 63)
@@ -0,0 +1,49 @@
+#!/bin/sh
+###############################################################
+# 
+# Purpose: Automated build and update of pgRouting website
+# Authors: Daniel Kastl <daniel@georepublic.de>
+#
+###############################################################
+# Copyright (c) 2010 Georepublic UG
+#
+# Licensed under the GNU LGPL.
+# 
+# This library is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation, either version 2.1 of the License,
+# or any later version.  This library is distributed in the hope that
+# it will be useful, but WITHOUT ANY WARRANTY, without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Lesser General Public License for more details, either
+# in the "LICENSE.LGPL.txt" file distributed with this software or at
+# web page "http://www.fsf.org/licenses/lgpl.html".
+#
+
+# About:
+# =====
+# This script will run the following tasks
+#       - Update to the latest changes of the workshop repository 
+#       - Build documentation with Sphinx
+#
+# NOTE: This script was written to run on Ubuntu server. 
+#		It requires an existing
+#		clone of pgRouting workshop repository
+
+# Running:
+# =======
+# This script can run as cron job for example
+# ./checkout.sh
+
+REPDIR="/opt/pgrouting/workshop/docs/"
+WEBDIR="/var/www/pgrouting-workshop/"
+
+cd $REPDIR
+
+# Update to latest version
+git pull -q origin
+
+# Create HTML
+sphinx-build -b html -Q $REPDIR $WEBDIR
+
+
Index: /trunk/workshop-routing-foss4g/index.rst
===================================================================
--- /trunk/workshop-routing-foss4g/index.rst	(revision 63)
+++ /trunk/workshop-routing-foss4g/index.rst	(revision 63)
@@ -0,0 +1,28 @@
+.. Workshop - FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt documentation master file, created by
+   sphinx-quickstart on Sat Jul  3 21:23:22 2010.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+==============================================================================================================
+pgRouting Workshop Manual
+==============================================================================================================
+
+*"FOSS4G routing with pgRouting tools, OpenStreetMap road data and GeoExt"*, primarly written for the `FOSS4G2011 Workshop <http://2011.foss4g.org/sessions/foss4g-routing-pgrouting-tools-openstreetmap-road-data-and-geoext>`_.
+
+.. rubric:: Contents
+
+.. toctree::
+   :numbered:
+   :maxdepth: 2
+
+   chapters/introduction.rst
+   chapters/about.rst
+   chapters/installation.rst
+   chapters/osm2pgrouting.rst
+   chapters/topology.rst
+   chapters/shortest_path.rst
+   chapters/advanced.rst
+   chapters/php_server.rst
+   chapters/geoext_client.rst
+
+
