Nominatim not match when using q parameter

277 views Asked by At

I have the following issue.I want to use Nominatim to find coordinates from a textbox value i also add a select list with the country to make it easier to find.But the problem is : When is i use the q parameter:

http://nominatim.openstreetmap.org/search?format=json&q=Berlin&country=Germany

this gives me back some other Berlins which is in the Us for example. But when i use the city parameter insted of q its works fine.

 http://nominatim.openstreetmap.org/search?format=json&city=Berlin&country=Germany

But the problem is i can not use allways the city parameter because of the possibility of a town insted of city.

1

There are 1 answers

4
scai On

Please see the documentation. You can't combine parameter q with any of the alternative search parameters. Instead you can give a more specific query string including the country:

http://nominatim.openstreetmap.org/search?format=json&q=Berlin,%20Germany