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

Search for cities with nominatim

2
1

Hi, i try to build an autocomplete textbox which should display countries and cities. Because the list should also care for variant names of cities and countries and different languages (like i.e. "Cologne" or "Köln") I thought about using nominatim. Unfortunately I cannot find any help on how to filter the resultset to just cities and countries. Any help is highly appreciated :-).

your's felix

asked 24 Sep '13, 15:27

felixhelix's gravatar image

felixhelix
41114
accept rate: 0%


2 Answers:

2

Take a look at the parameters. If you want to limit your search to cities and countries only then just set the city or country parameter, e.g.

http://nominatim.openstreetmap.org/search?city=Köln

and

http://nominatim.openstreetmap.org/search?country=Croatia

Setting both at the same time only works if both are actually part of the address. In this example it won't work because there is no city named Köln in Croatia.

answered 24 Sep '13, 17:09

scai's gravatar image

scai ♦
33.3k21309459
accept rate: 23%

Thanks Scai: Then I could build two queries and merge the results - this can be a solution - but with an overhead.

(26 Sep '13, 08:28) felixhelix

2

Maybe a look at Photon can be helpful?

answered 25 Sep '13, 17:17

stephan75's gravatar image

stephan75
12.6k556210
accept rate: 6%

Yes, maybe I'll give it a Iook - the description sounds very promising. But I have to set photon and nominatim up on my own - haven't I? I guess that exceeds my skills by now. I just want to simply fire a request and get results - lazy guy that I am.

(26 Sep '13, 08:35) felixhelix

Source code available on GitHub .