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's gravatar image

Coder123
16335
accept rate: 0%

edited 14 Mar '17, 17:51

I am also looking for the same solution. Anyone?

(03 Jun '17, 08:59) carapace

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.

permanent link

answered 03 Jun '17, 09:16

SomeoneElse's gravatar image

SomeoneElse ♦
33.7k67354807
accept rate: 15%

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.

permanent link

answered 03 Jun '17, 18:35

Coder123's gravatar image

Coder123
16335
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×240

question asked: 14 Mar '17, 17:50

question was seen: 1,682 times

last updated: 03 Jun '17, 18:35

powered by OSQA