i want to import a big (10G) OSM network into PostGIS for pgRouting. As i have to do some postprocessing with Postgres i need to load some key/values from the OSM dataset into the database as well, e.g. maxspeed=.

What's the best way for that?

Right now i tried the following ways:

  1. Import with osm2pgrouting. Failed, didn't even import the network, most likely due to the big network file.
  2. Import with osm2po: Works, but it seems really hard/impossible to keep certain key/values from OSM.
  3. Import the network with osm2po AND import the .OSM file a second time with osm2pgsql, subsequently merging the tables. Takes hours as it seems impossible to use osm2psql without importing the geometries (which i don't need obviously).

1 Answer 1


Speaking of osm2pgrouting you're correct that there is a limit in how large the OSM data can be, that you can import at once. But you can split your data into parts and import it incrementally. If the database table exists already only missing network data will be added.

With the --attributes flag you can import all the other OSM attributes.

  • I have an OSM File having size 10GB.Having complete data highways=*. What is the best query for osmosis to split correcly. My intention is to use it for pgRouting. and to import and work in Database
    – Lijo John
    Sep 29, 2021 at 4:57
  • I would split based on bounding box(es) wiki.openstreetmap.org/wiki/Osmosis/…
    – dkastl
    Sep 30, 2021 at 5:03

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.