Reducing the memory footprint of OSM map

We use OSM maps for routing, however, the memory footprint of the OSM data becomes very large (almost 10 Giga for the USA).

Obviously, OSM includes many fields that are not needed for routing.

Is there a way to get only the needed data from OSM?

Hi Safra,
There are tools which can accept or reject parts of OSM data once you downloaded it. That can indeed be helpful. One of them is osmosis, some examples of how to use only certain types of ways can be found here. I used the following code for my projects:
osmosis --read-pbf /path/to/file/DACH-latest.osm.pbf --tf accept-ways highway=* --used-node --write-xml highwaysDACH.osm

Also check out the description of osmconvert. I think it does not do exactly what you need, but certain features can be quite useful (e.g. “Keeping Cross-Border Multipolygons Complete” as the subtitle already says).

Hope it helps!

1 Like
Powered by Discourse