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

Just loading planet_osm_polygons to PostGIS

0

Hi all,

Slightly similar to another question I've already asked, but I think it deserved it's own thread. I am running the below to import a Europe PBF to PostGIS. But I actually only need the building polygons (planet_osm_polygons). Is there a way to only import that table and skip the others? (and would doing so have a detrimental effect?)

osm2pgsql -d osm_europe --style openstreetmap-carto/openstreetmap-carto.style -U james -H localhost --hstore --slim -G europe-latest.osm.pbf

I've seen some examples of doing this using osmosis I think, but I've struggled getting that running, so think I'd like to stick to osm2pgsql . I guess I can always delete the tables I don't need afterwards, but it'd be nice to not import them in the first place.

asked 19 Apr '18, 10:19

TheRealJimShady's gravatar image

TheRealJimShady
16225
accept rate: 0%


One Answer:

0

Perhaps could you appky tge blackhole_fdw triggers from Andrew Dunstan https://bitbucket.org/adunstan/blackhole_fdw and use the --append option.

Or else, if you decide to modify osm2pgsl, there are only 4 or 5 lines of code to comment.

Note that there are also 7 to 8000 (geo-) lines with the correct buildings tags.

answered 11 May '18, 02:25

AntaC's gravatar image

AntaC
13115
accept rate: 0%