[postgis-users] line_locate_point() function

Emily Gouge egouge at refractions.net
Thu Jan 12 13:41:07 PST 2006


Hi all,

I have a linestring and a point that I am passing to the line_locate_point() function.  The point is 
identical to the last coordinate of the linestring, however the line_locate_point() function is not 
returning 1 as I would expect.  Is this a bug or am I doing something wrong?

The query:

select line_locate_point(geomfromtext('LINESTRING(-1953743.873 471070.784,-1953735.105 
471075.419,-1953720.034 471081.649)', 6269), geomfromtext('POINT(-1953720.034 471081.
649)', 6269));
  line_locate_point
-------------------
   0.99895463120899
(1 row)


An interesting thing to note is if I remove the middle coordinate of the linestring I do get 1:
select line_locate_point(geomfromtext('LINESTRING(-1953743.873 471070.784,-1953720.034 471081.649)', 
6269), geomfromtext('POINT(-1953720.034 471081.649)', 6269));
  line_locate_point
-------------------
                  1

select * from postgis_full_version();
                            postgis_full_version
--------------------------------------------------------------------------
  POSTGIS="1.1.1CVS" GEOS="2.1.1" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS


Thanks,
Emily



More information about the postgis-users mailing list