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

I am not geeting city name always in search api response

0

Hello,

I am not getting city always in API response when i search for a address.

Here is the address: Bahnhofstrasse 1 8001 Zu

Here is URL which i am using for search address:

https://nominatim.openstreetmap.org/search?q=Bahnhofstrasse%201%208001%20Zu&format=json&polygon=1& addressdetails=1&limit=6&countrycodes=CH&accept-language=de

alt text

Can you please help me on this why i am not getting city with this address?

Thanks Siyaram

asked 11 Jul '22, 07:02

Siyaram%20Test's gravatar image

Siyaram Test
11112
accept rate: 0%

1

What city name would you expect for this location? The results give you the name of the village (which may be the closest thing to a "postal city" here, it is used in the addr:city tags). The results also include various levels of administrative division. It all looks reasonable for a rural area far from a city. I'm not sure anything is missing.

(11 Jul '22, 09:07) alan_gr

One Answer:

3

Nominatim does not offer autocomplete or autosuggest. So it does not expand your search of "Zu" to "Zurich".

If you need an autosuggest/autocomplete function, you'll have to look to other geocoders, e.g. photon or pelias.

Example:

https://photon.komoot.io/api/?q=Bahnhofstrasse%201%208001%20Zu

answered 11 Jul '22, 09:59

Spiekerooger's gravatar image

Spiekerooger
3.1k22356
accept rate: 16%

edited 11 Jul '22, 09:59