[postgis-tickets] [PostGIS] #2452: KNN Gist for geography

PostGIS trac at osgeo.org
Wed Aug 28 21:38:52 PDT 2013


#2452: KNN Gist for geography
-------------------------+--------------------------------------------------
 Reporter:  robe         |       Owner:  pramsey      
     Type:  enhancement  |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.2.0
Component:  postgis      |     Version:  2.0.x        
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by pramsey):

 It's a verrrry iffy proposition. KNN works by calculating the distances
 between the index keys. for 2d, those keys are in the same "space" as the
 objects they proxy for, but even there things get confusing as the boxes
 have to proxy for non-box things like lines/polygons.

 Now, go into sphere-land. The objects are points/line/polygons traced on a
 sphere. The *keys* are three-space boxes in geocentric space that contain
 those objects. So, as with lines/polys in 2d space, the sort distance
 between the keys is *similar* to the real sort distance between the
 objects, it is not the *same*, and it's even harder to visualize and
 explain.

 And for points, it's not exact either, since a KNN search would ideally
 put objects in their order relative to their spherical distance, the KNN
 sort on points would return objects based on their geocentric distances
 from one another.

 I'll leave it to you to decide if this is a "no way". It'll never return
 exact correct results, for *any* geometry type, only approximations.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2452#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list