[Geocoding] [OpenStreetMap] #4519: Reverse geocoding gives city of nearest object, not city of current position

OpenStreetMap trac at openstreetmap.org
Tue Aug 14 10:39:10 BST 2012


#4519: Reverse geocoding gives city of nearest object, not city of current
position
-------------------------------+--------------------------------------------
 Reporter:  AlphaTiger         |       Owner:  geocoding@…                
     Type:  defect             |      Status:  new                        
 Priority:  major              |   Milestone:                             
Component:  nominatim          |     Version:                             
 Keywords:  reverse geocoding  |  
-------------------------------+--------------------------------------------

Comment(by cquest):

 The problem lies in using only ST_Distance to order the result.

 A better result could be obtained by mixing the selected objets based on 2
 different criterias: ST_Distance to name the nearest object (the name of
 the road/street) and ST_Distance(ST_Centroid()) to get the details about
 the city/town of the given location and not using the one of the centroid
 of the nearest objet which can actually be quite far away.

 In order to do this, the SQL query needs to provide both ST_Distance and
 ST_Distance(ST_Centroid()) in its results (which should be minimal
 additionnal cost in the query) and have some additionnal post-processing
 in the php code only when the difference between both distances is
 significant.

-- 
Ticket URL: <https://trac.openstreetmap.org/ticket/4519#comment:2>
OpenStreetMap <http://www.openstreetmap.org/>
OpenStreetMap is a free editable map of the whole world



More information about the Geocoding mailing list