I have downloaded the pbf file for India. I would like to extract all cities and suburbs/villages within the city hierarchically. I have tried the below command in osmosis, ./osmosis --read-pbf india.osm.pbf --tf accept-nodes place=city,town,village,neighbourhood,city_district,locality --tf reject-relations --tf reject-ways --lp --wx places.osm While I am able to get list of all the places, I am not able to relate which village/suburb etc,. belong to which city. Is there any way I can extract such information through osmosis? Or can it be done through any other tools? asked 14 Mar '17, 17:50 Coder123 |
I suspect that the answer is "no" with osmosis. Nominatim (which you can install locally) has an understanding of place hierarchies (based on areas at least). If you test a few searches at http://nominatim.osm.org/ does it return sensible results for you? If so, perhaps install a copy of that locally and use that. answered 03 Jun '17, 09:16 SomeoneElse ♦ |
With osmosis, I was able to extract all the villages and suburbs. Then i wrote a separate program which pings the osm db with the nodeid in an interval of every 20s and extracted the city/state information. It was a time consuming task but I was able to get what I needed. You could try a similar approach if you have a restricted geographical limits. answered 03 Jun '17, 18:35 Coder123 |
I am also looking for the same solution. Anyone?