Open OhmSpectator opened 4 years ago
To retrieve only the ways for the area that corresponds to the first occurrence of the {city} parameter, you can use the following query:
area[name="{city}"][1];
(way["highway"](area); >;);
out skel;
The [1] operator in the area parameter specifies that only the first matching area should be returned. This ensures that you will only get the ways for the Berlin in Germany and not in the USA or any other place with the same name.
For example: "--city Berlin" returns besides german one, a city in the USA.
In overpass-turbo API there is an extension that returns only the first appearance (
{{geocodeArea:name}}
). Implement something like this.Useful links: