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

Export hierarchical structure of (administrative) relations

0

I'm looking for a way or tool to get a list of all type=boundary, boundary=administrative relations and their hierarchical structure (relation A has children B and C and B has children D and E and so on...). So something like: all boroughs of Berlin, Germany and all localities of all the boroughs of Berlin, Germany (Wikipedia).

Basically, I only need the osm_ids.

I tried using the Overpass API (https://overpass-turbo.eu/s/1aVA) but unfortunately it's very slow and I only get the immediate children. Now I could make a request for each of the children and get their children etc, but it takes forever.

Is there any good tool or way to achieve this? I'm sure I'm not the first to need the hierarchical structure of relations.

asked 06 Sep '21, 15:46

foodev's gravatar image

foodev
11112
accept rate: 0%


One Answer:

0

Have a look at OSM Boundaries. I haven't used it myself do download data but it seems to provide what you are looking for.

answered 06 Sep '21, 20:07

TZorn's gravatar image

TZorn
12.3k764225
accept rate: 15%

Source code available on GitHub .