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

Overpass Turbo query for city/voivodeship/city hierarchy in poly

1

Hey guys!

I ask for a hint how to build a query that will provide me a poly of each city in voivodeship.

Thanks!

asked 18 Jun '21, 10:52

siemaeniownik's gravatar image

siemaeniownik
26223
accept rate: 0%


One Answer:

0

Here is an example for municipalities in "Lower Silesian" in Poland:

[out:json][timeout:120];
{{geocodeArea:Lower Silesian}}->.searchArea;
(
  relation["admin_level"="7"](area.searchArea);
);
// print results
out body;
>;
out skel qt;

If the voivodeship has its municipalities or cities as ways instead of relations, just change "relation" to "way" in the code above.

If you really only want cities instead of municipalities, change the admin level from 7 to 8 (might time out). If you want this query for another country (you didn't specify), take a look at this table to see which admin level you need:

Tag:boundary=administrative

answered 24 Jun '21, 12:13

Discostu36's gravatar image

Discostu36
2361211
accept rate: 0%

Source code available on GitHub .