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

Nominatim returning nearby cities instead of the current city on roads that span multiple cities

0

I'm using the latitude/longitude argument to get the current town the user is in from nominatim, but sometimes when the user is on long roads that span multiple towns it gives a neighboring town instead of the town they are currently in. For example, the coordinates (41.036389, -74.031476) are clearly inside the borders of Park Ridge but nominatim says the nearest road, Kinderkamack Road, is located in Woodcliff Lake so the field that returns the town/city in nominatim says the user is in Woodcliff Lake instead of Park Ridge. Is there any way to accurately get the city/town the user is in with nominatim?

asked 19 Jun '16, 16:22

pdrum1030's gravatar image

pdrum1030
11113
accept rate: 0%

edited 19 Jun '16, 16:24


One Answer:

2

In the Nominatim database each street section (way) is linked to one parent only. During reverse geocoding it's not re-evaluated if the coordinate might be in a different parent (city). Setting &zoom=10 (city level) limits the output and takes shortcuts in the search logic but has the same behavior. If there were houses on that street or the street split at the city boundary the result would be better, I don't recommend changing OSM data over this though. Currently it's a limitation (bug) in Nominatim, in worst case if a street crosses country borders it even returns the wrong country.

answered 19 Jun '16, 22:12

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

Source code available on GitHub .