[postgis-users] ERROR Update query with ST_Line_Locate_Point

Chris Kelley iamchriskelley at gmail.com
Sat Apr 7 16:41:44 PDT 2012


Hi,

Using postgis 1.5 to update a table of points along a line with their
fractional position along that line. I have confirmed that a select query
returns good results:

select st_line_locate_point(a.the_geom, b.the_geom) as line_frac from
road_table a, points_table b;

This does not work properly however if I use an update query:

update points_table set line_frac = st_line_locate_point(a.the_geom,
b.the_geom) from road_table a, points_table b;

In that case, the query still processes but all line_frac entries in
points_table have what is the highest value in the select query; i.e. the
value that should only belong to the point furthest down the road.

Does anyone know what's going on here and how to fix it? Didn't find
anything on this online.

Thanks,
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120407/fd56b36c/attachment.html>


More information about the postgis-users mailing list