OhmSpectator / streetviews-grabber

A script that grabs Google Street View for a city.
Other
7 stars 1 forks source link

[OSM] Handle only the first result of the city search #8

Open OhmSpectator opened 4 years ago

OhmSpectator commented 4 years ago

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:

OhmSpectator commented 1 year 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.