Caution- this post won’t make you a pgRouting guru, but it will allow you to get pgrouting up and running on Ubuntu 11.10 and have some data on a map in approx 20 minutes.
** Update (17th August 2012)- the instructions below will continue to work for PostgreSQL 9.1 and PostGIS 1.5 on Ubuntu 12.04 or variants thereof. The fix mentioned in step 2 will lead you to a 404 error on github-this is currently correct though.**
Follow the instructions here to install PostgreSQL, PostGIS and pgRouting. Note that the instructions are for PostgreSQL 8.3 but they work just as well for PostgreSQL 9.0, just go with whatever version you want and substitute the package name accordingly.
If you’re using PostgreSQL 9.0, you might hit an error when loading the driving distance functions, as seen here. There’s a fix, which may or not have been committed by the time you try this- if not then you need to apply it by replacing two altered files and recompiling/making and installing pgrouting (repeat the “compile pgRouting” step in the link in step 1).
Go here and download a selection of osm binary (pbf) files.
Follow the instructions here to download and run osm2po. Note that the documentation is currently available only in german. However, the example given in the link will work to get you a working demo, and it’s quite easy to follow the examples. Note also that you need a java runtime environment to use this- so if you don’t have one then download the jre of your choice using your favourite software package manager.
If this whets your appetite and you want to learn more, then there’s an excellent workshop available on the pgRouting site, along with lots of useful howtos and tools.
This, of course, only scratches the surface of pgRouting, but it just goes to show that thanks to all of the great links I’ve listed above, it is possible to get a working demo going extremely quickly.