This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

PostGIS: Load Only OSM Lines and Polygons Using osm2pgsql

0

I'm using OSM2PgSQL to load osm data into my PostGIS db. I am shortage of space and also do not need the entire data to be loaded. I only want to load osm_lines and osm_polygons. How can I configure this?

Any other import tool which would help me accomplish this would do as well.

asked 26 Aug '17, 10:27

Ones%20Infinite's gravatar image

Ones Infinite
61338
accept rate: 0%

edited 27 Aug '17, 20:21

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701


One Answer:

1

You need to edit the default.style file to only import what you are interested in and drop the slim mode tables once you've imported. In any case you will still be initially importing nodes because they are required for building the geometries (and given that most OSM nodes are actually way nodes it is going to be nearly all of them).

With other words at least temporarily you will need more space or lots of memory to be able to run osm2pgsql in non-slim mode.

answered 27 Aug '17, 20:18

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

edited 27 Aug '17, 20:19

Source code available on GitHub .