I have written a query to get a countries sub regions by first querying for the country relation, then recursing down, then filtering the relations by
This query works well for countries such as Spain ( However, countries such as Croatia (HR) only return the country relation .c when this query is executed, inspection of the result shows that the Croatia relation has no member relations with the subarea role, and thus the recursion returns an empty set. It is important to me that I am able to build a hierarchy from the results and I have not been able to create a query which returns a nations regions for a country such as Croatia where the country relation has no subareas. I do not mind executing another query or going to another openstreetmap source if the first query should return only the country relation. Do you know of any way to query Overpass to get a heirarchy of a countries sub regions when the relations members have no subarea role? Or another source for the information? Or some other way of achieving the same result? Any help is greatly appreciated. asked 24 May '18, 09:49 dreggers |
Here's a query that fetches objects tagged with admin_level from a given country:
Overpass-API creates the answered 25 May '18, 23:22 maxerickson That was very helpful. Thank you very much!
(02 Aug '18, 17:11)
rene78
|
crossposting: https://gis.stackexchange.com/questions/283925/overpass-api-fetch-country-regions-where-no-subarea-relation