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

OSM filter

0

Hey I converted a OSM file to CSV, with:

osmconvert64.exe netherlands-latest.osm --max-objects=999999--all-to-nodes --csv="@lat @lon addr:street addr:housenumber addr:postcode addr:city" -o=streets.csv

And I want to import the CSV into MySQL-database, but the file is 3GB. I noticed that in the CSV file their is sometimes lat/lon, but no addr data. Is their a way I can filter out records that don't have the addr data? (To reduce filesize CSV, and unwanted data)

I tried: osmfilter.exe netherlands-latest.osm --keep="@lat= and @lon= and addr:street= and addr:housenumber= and addr:postcode= and addr:city= and @lat!=null and @lon!=null and addr:street!=null and addr:housenumber!=null and addr:postcode!=null and addr:city!=null" -o=netherlands-filtered.osm

osmfilter.exe netherlands-latest.osm --keep="addr:street!=null and addr:housenumber!=null and addr:postcode!=null and addr:city!=null" -o=netherlands-filtered.osm

asked 04 Oct '19, 21:21

JSteen's gravatar image

JSteen
11112
accept rate: 0%

edited 04 Oct '19, 21:23

Source code available on GitHub .