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

How to extract all admin_centres of an area?

0

In this query

[out:csv(::id, ::type, name, "name:te", wikidata)];
area["boundary"="administrative"]["admin_level"="4"]["name"="Andhra Pradesh"]->.searchArea;
(   relation["boundary"="administrative"]["admin_level"="6"](area.searchArea);
    node(r:"admin_centre")->.result;
);
/*(._ ; > ;);*/
.result out;

The result shows only 666 admin_centres. There are actually 670 admin_centres with 668 distinct ones. The missing admin_centres are https://www.openstreetmap.org/node/3665399128 and https://www.openstreetmap.org/node/2408119848

asked 19 Jul '21, 07:59

arjunaraoc's gravatar image

arjunaraoc
26113
accept rate: 0%

edited 19 Jul '21, 08:00


One Answer:

0

I realised that relations with common admin_centre are present in output and there are 4 such duplicates

answered 19 Jul '21, 11:57

arjunaraoc's gravatar image

arjunaraoc
26113
accept rate: 0%

Source code available on GitHub .