Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4990 closed defect (wontfix)

Reverse geocode wrong state on zoom 18

Reported by: emilio.mejia@… Owned by: geocoding@…
Priority: minor Milestone: Wishlist
Component: nominatim Version: 2.0
Keywords: Reverse geocode Cc:

Description

I installed on my server nominatim. But entering a query in reverse geocode with different zoom get a different state. In the zoom 18 state is wrong, in zoom 12 state is correct.

-<reversegeocode querystring="format=xml&lat=10.34368&lon=-84.4336666666667&zoom=18&addressdetails=1" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" timestamp="Sat, 21 Sep 13 09:31:21 -0500"><result lon="-84.4479768" lat="10.3621444" ref="141" osm_id="28444424" osm_type="way" place_id="472458">141, Florencia, Heredia, 4400123, Costa Rica</result>-<addressparts><road>141</road><town>Florencia</town><state>Heredia</state><postcode>4400123</postcode><country>Costa Rica</country><country_code>cr</country_code></addressparts></reversegeocode>

-<reversegeocode querystring="format=xml&lat=10.34368&lon=-84.4336666666667&zoom=12&addressdetails=1" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" timestamp="Sat, 21 Sep 13 09:33:34 -0500"><result lon="-84.476719" lat="10.3600898" ref="Florencia" osm_id="846392017" osm_type="node" place_id="158944">Florencia, Alajuela, Costa Rica</result>-<addressparts><town>Florencia</town><state>Alajuela</state><country>Costa Rica</country><country_code>cr</country_code></addressparts></reversegeocode>

Change History (8)

comment:1 Changed 6 years ago by Sarah Hoffmann

Resolution: wontfix
Status: newclosed

This might happen because reverse actually returns the address of the nearest object and not the address of the geographic point you asked for. As the address of each object is computed independently, this might lead to different results when places are mapped as nodes only and Nominatim has to guess about which object belongs where.

In your example the nearest object at zoom 18 is a street which was computed as being in Heredia because that is the closest state place node, while at zoom 12 the closest object is the city of Florencia which got put in state Alajuela because of the is in. As it happens, this particular case can be easily fixed by adding admin boundary relations for the states. It looks like the boundary ways are already there, e.g. this way.

Last edited 6 years ago by Sarah Hoffmann (previous) (diff)

comment:2 Changed 6 years ago by emilio.mejia@…

Tks.

We speak the same geographical point ? lat=10.34368&lon=-84.4336666666667

OSM, checked:

Florencia: Town Boundary: correct, level 4 is_in = Alajuela

Other points of other provinces seem equally skip administrative borders, which I can do so that these are not omitted from the querys?

comment:3 Changed 6 years ago by Sarah Hoffmann

Yes, same point. The state for the town is correct, the street you get with zoom=18 is the one which is put in a different province because the place node is closer and the street does not have a is_in tag.

You need to add boundary relations for all provinces in Costa Rica. Currently there are only boundary ways. That is not sufficient for computing correct addresses.

Last edited 6 years ago by Sarah Hoffmann (previous) (diff)

comment:4 Changed 6 years ago by Sarah Hoffmann

Please don't start to add is_in tags to roads. That is the wrong way to solve this problem. Fix the boundaries.

comment:5 Changed 6 years ago by emilio.mejia@…

No tags is_in on roads. I understand that I should not because it would cause errors in other points. However I have carefully reviewed the boundary is are fine.

comment:6 Changed 6 years ago by Sarah Hoffmann

No, the boundaries are not fine because there are no boundaries. You absolutely must create relations, like this one. If there are no boundary relations, there is no way for Nominatim to find the boundaries of your provinces. Ask other local mappers for help if you don't know about relations or don't know how to create them.

comment:7 Changed 6 years ago by emilio.mejia@…

Understand, tks.

comment:8 Changed 6 years ago by emilio.mejia@…

Boundaries finish 22/09.

Tested:

http://nominatim.openstreetmap.org/reverse?format=xml&lat=10.3116016666667&lon=-84.1814116666667&zoom=18&addressdetails=1

Result: (OK) <state>Alajuela</state>

http://192.168.1.117/nominatim/reverse?format=xml&lat=10.3116016666667&lon=-84.1814116666667&zoom=18&addressdetails=1

Result: (Wrong) <state>Heredia</state>

The local server is update to : Data: 2013/09/25 19:13 GMT

I need to make some additional changes to my server or in osm?

Note: See TracTickets for help on using tickets.