[postgis-devel] [PostGIS] #1271: ST_Line_Locate_Point inaccurate closest point

PostGIS trac at osgeo.org
Mon Nov 7 15:04:04 PST 2011


#1271: ST_Line_Locate_Point inaccurate closest point
---------------------+------------------------------------------------------
 Reporter:  strk     |       Owner:  strk         
     Type:  defect   |      Status:  assigned     
 Priority:  high     |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------

Comment(by nicklas):

 I think you have a typo in r8107.
 pa->npoints is 1-based, not 0-based, right?

 Then shouldn't it be instead?:


 {{{
 if ( t >= pa->npoints &&
   ( proj.x == end.x) && (proj.y == end.y) )
 }}}

 That would explain it since the answer from st_closestpoint is the same as
 the second last vertex, not the last.

 /Nicklas

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1271#comment:2>
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-devel mailing list