I want to import multiple OSM data files for a few different countries into postgres using osm2pgrouting.

Can I just run osm2pgrouting on each file with the same database settings (e.g., import countryA.osm, then countryB.osm, etc.) or would this cause problems?

1 Answer 1


I did some investigating and found that osm2pgrouting does NOT support importing multiple files.

FYI, it seems that there are currently only a couple of alternatives:

  1. Modify the osm2pgrouting source code and re-build it using this patch (which someone has copied and pasted to GitHub here for posterity). Note that this appears to be the work of a single person and doesn't appear to be a formal project. Aside from the spartan "how to" on the patch page, this forum thread has some add'l info (albeit not much more).
  2. Use a Java-based tool called osm2po. I haven't tried this yet, but this tool appears to be mostly geared towards importing OSM data into PostGIS to allow an app called Quantum GIS (aka QGIS) to do routing (i.e., it doesn't produce the same tables/columns as osm2pgrouting). This StackExchange post seems to indicate that it's possible, however, and that the osm2po manual provides hints. Unfortunately the manual is in German.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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