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

Removing map data that has been imported to gis

1

How can I remove map data that I've imported to the gis database? I'm working with a limited amount of space and when i tried to import new map data, it eventually failed due to lack of memory. Thanks in advance.

-NDFobia1158

asked 05 Oct '11, 14:33

NDFobia1158's gravatar image

NDFobia1158
61447
accept rate: 0%

edited 05 Oct '11, 14:35

4

What apps are you using?

(05 Oct '11, 14:47) Firefishy ♦♦

I'm using osm2pgsql

(14 Oct '11, 14:28) NDFobia1158

One Answer:

2

I mention you are working with an PostGis DB and using a script to import OSM to the DB, somthing like Osm2pgsql or Osmosis.

You can filter the OSM-Data before importing by using Osmosis. eg:

osmosis --read-xml city.osm --way-key-value keyValueList="railway.tram, railway.tram_stop" -used-node idTrackerType=BitSet --write-xml city_tram.osm

here are some examples: https://wiki.openstreetmap.org/wiki/Osmosis#Example_Usage

and the Usage: https://wiki.openstreetmap.org/wiki/Osmosis/Detailed_Usage

answered 06 Oct '11, 10:21

josias's gravatar image

josias
59871523
accept rate: 33%

edited 06 Oct '11, 10:22

It depends on what data you want to ignore. You can reduce the bbox or filter the data as josias has mentioned. You can also edit the input style file for osm2pgsql for limiting the data imported.

(14 Oct '11, 16:43) NicolasDumoulin

Source code available on GitHub .