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

Getting null values against keys ?

0

Thank you for providing osm cake, that is wonderful an offer.

Attempted to read india-latest.osm.pbf to .csv file using osmconvert.exe. Built structure with following keys: addr:street addr:postcode addr:district addr:subdistrict addr:state addr:country @id @lat @lon

The outcome showed values only for three keys: id, latitude, longitude. The rest were null. Need your support to know the reason for null output and how get value instead.

The command used in osmconvert.exe is given below osmconvert india-latest.osm.pbf --csv="addr:street addr:postcode addr:district addr:subdistrict addr:state addr:country @id @lat @lon" -o=indiancountry.csv

asked 23 Aug '18, 05:34

mbracedevelop's gravatar image

mbracedevelop
11112
accept rate: 0%


One Answer:

0

I'm not 100% sure how osmconvert works, but I suspect that if there is no tag for those keys, then it will output a null value. So what you're seeing makes sense. Additionally, OSM has plenty of objects that do no have address details, so you might want to filter it first.

answered 23 Aug '18, 12:28

rorym's gravatar image

rorym
5.4k1449100
accept rate: 11%

1

Yes you will need to filter the data only for those keys: something like : 1. osmconvert india.pbf --out-o5m >india.o5m 2. osmfilter --keep="addr:street"= india.o5m >india.addr.o5m 3. osmconvert to csv.

You will probably need quite a complex filter to cover addresses with only some of the addr:* tags you want. Also if you want pure lat/lon I'd recommend using --all-to-nodes.

(23 Aug '18, 14:35) SK53 ♦

Tried the script. Displayed error :could not get 183500800 bytes of memory

(25 Aug '18, 04:54) mbracedevelop

Source code available on GitHub .