I'm trying to run osm2pgrouting and on Ubuntu 12.04...everything looks like it's working until it gets to "classes table created" when it just stops. I'm watching the process with the system monitor and it looks like it's loaded the whole OSM file into memory(the RAM used by the program is about the same size as the file, ~200MB). But once it gets to that part the CPU usage goes down to nothing and it doesn't do anything. The program doesn't crash or anything, it just seems to go on break.

Here's my command:

osm2pgrouting -file file.osm -dbname osm -user name -conf mapconfig.xml -clean -passwd xxx


  • Which version of PostGIS do you use?
    – dkastl
    Mar 9 '13 at 2:53
  • 2.0.1-2~precise3 Mar 9 '13 at 5:14

another simple option could be switch to osm2po (www.osm2po.de) tool that works with PostGIS 2.0 and could cook sql-script for osm to pgRouting data transformation.


osm2pgrouting doesn't work with PostGIS 2.0 yet, because it creates MultiLinestring geometries while the ST_Startpoint function of PostGIS now only works with Linestring.

What you can do for now is to either fix the osm2pgrouting source and recompile, or use the Ubuntu package and load the legacy.sql functions and later alter the geometry manually and run assign_vertex_id again.

 ALTER TABLE ways ALTER COLUMN the_geom TYPE geometry(Linestring,4326) USING ST_GeometryN(the_geom, 1);
 SELECT assign_vertex_id('ways', 0.00001, 'the_geom', 'gid')

The OSGeo Live DVD install script does like that. You can take a look: http://trac.osgeo.org/osgeo/browser/livedvd/gisvm/trunk/bin/install_pgrouting.sh

  • I'm afraid your answer is a little over my head. Can you give me an idea what I would need to do to the osm2pgrouting code to make it work? I loaded the legacy.sql functions, then tried running osm2pgrouting again. It did the same thing. I then tried altering the geoemetry column in the ways table per your code. This looks like what that script you linked to was doing. I then tried to run osm2pgrouting again with the altered ways table and it did the same thing. What did I miss? Thanks! Mar 9 '13 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.