ebmgh.com

80% of American voters Support Action on Clean Energy, Climate Protection »« MySQL vs PostgreSQL

Computing Directions with pgRouting

Really interested in setting up and trying out pgRouting for the bike mapper. It looks like it will handle a lot of the difficult stuff automatically (at least in theory). This post is my start at checking it out.

The software is an extenion to PostGIS, and was created by Sylvain Pasche from CamptoCamp and maintained by a Japanese company called Orkney, which looks like a GIS and web company that is involved in open source projects like OSGeo.

I suspect that the developers would rather spend time writing code than writing documentation, but there is a wiki, and a few examples. It is thin in places, but it has much more content than it did when I looked at it a year ago.

http://pgrouting.postlbs.org/wiki/

Example of pgRouting query and output, from the wiki

Example of pgRouting query and output, from the wiki

One cause for concern: why are there so few live examples? Nearly all the examples on the demo pages have been crossed out with a strikethrough, and the few live links don’t seem to work. The notable exception is ridethecity.com, which is up and running (but does not appear to be open source).

Here is a nice, simple overview (in pictures) with few words, of what pgRouting does: Shortest Path Search for Real Road Networks and Dynamic Costs with Pgrouting (slideshow).

This presentation will show the inside and current state of pgRouting development. It will explain the shortest path search in real road networks and how the data structure is important for getting better routing results. We will show how you can improve the quality of the search with dynamic costs and make the result look closer to the reality. We will demonstrate the way of using pgRouting together with other Open Source tools. Also you will learn about difficulties and limitations of implementing routing functionality in GIS applications, the difference between algorithms and their performance.

pgRouting can perform:

  • shortest path search (with 3 different algorithms)
  • Traveling Salesperson Problem solution (TSP)
  • driving distance geometry calculation

Here is the best technical guide that I have found on the internet (via BostonGIS):

David Techer provides a well diagrammed and thought out tutorial on installing and using PgRouting to calculate itineraries. Unfortunately its in French, but nevertheless still useful since its so well diagrammed even if you are not a French speaker. Check out David Techer’s routing tutorial at PgRouting tutorial:

http://www.davidgis.fr/documentation/win32/html/apa.html

Forunatelly (for me), I know French and find that his site has an incredible amount of detail. Techer’s blog also has a few posts in English, including this one, specifically about how to use the Shooting Star route-finding function in pgRouting:

http://www.davidgis.fr/blog/index.php?2008/07/24/349-shooting-star-…3

Here is another (much shorter) tutorial in English, from an unknown source at the University of Texas in Dallas:

http://www.utdallas.edu/~ama054000/rt_tutorial.html

There was a tutorial session at the FOSS4G 2007 conference called Web-based Routing: An Introduction to pgRouting with OpenLayers.

All the materials and notes are online. It’s Linux-centric, and uses OpenLayers and MapServer, which don’t really interest me, as I think it is too much overhead for just displaying a route on Google Maps, but it looks like there’s some really good information in there.

Links:

  • http://pgrouting.postlbs.org
  • http://www.postgresql.org
  • http://www.orkney.co.jp
December 19, 2009 at 7:27 am
Commenting is closed