Does osm2po support importing multiple OpenStreetMap files into the same Postgres/PostGIS database (i.e., to be used for routing)?

If yes, can the OSM files be for geographic regions that are not next to each other? For example, could I import something like NewYork.osm and SanFrancisco.osm into the same routing database?

Thanks!

up vote 4 down vote accepted

Yes, since version 4.6.9 it's possible.

  1. Convert NewYork and SanFrancisco separately, but use cmd=tj which processes phase 1 and 2 of osm2po's conversion chain only.
  2. Don't forget to set a meaningful prefix parameter for both, e.g. prefix=ny for NewYork.
  3. Use the same tileSize parameter for everything you are going to merge.
  4. The steps above result in two directories you can transform into a third one. e.g.:

java -Xmx1g -jar osm2po-core.jar cmd=m prefix=nysf ny sf

where cmd=m is the merge command and ny and sf the source directories (paths). You can even use wildcards here, but I do not recommend it.

Finally proceed with the merged directory and call phase 3 and 4 with

cmd=sp prefix=nysf.

By the way, there is no difference whether the regions intersect or not. You can even merge NewYork-Detailed, SanFrancisco-Detailed and US-Motorways-Only or sth. like that.

  • 1
    Thank you very much for not just answering 'yes', but explaining how it can be done! Greatly appreciated. – C.H. Sep 7 '13 at 9:26

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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