[postgis-users] line_interpolate_point does not return a point that intersects the line

Francis Markham u2546226 at anu.edu.au
Sun May 2 23:41:09 PDT 2010


Hi all,

I think I've got a bit of a problem with snapping points to lines.  I had
thought that using line_interpolate_point(..., line_locate_point(...)) would
do the trick, but this seems not to be the case:

gis=# SELECT ST_AsText(v.the_geom), ST_SRID(v.the_geom),
ST_AsText(r.the_geom), ST_SRID(r.the_geom) FROM road_segments AS r, venues
AS v WHERE v.venue_id = 29 AND r.gid = 100982;

                st_astext                 | st_srid
|
st_astext                                    | st_srid
------------------------------------------+---------+---------------------------------------------------------------------------------+---------
 POINT(415185.606066865 7827721.52951473) |   28353 |
LINESTRING(415250.679102704 7827994.85292521,415218.694181662
7827642.44920486) |   28353
(1 row)

gis=# SELECT ST_Intersects(ST_line_interpolate_point(r.the_geom,
ST_line_locate_point(r.the_geom, v.the_geom)), r.the_geom) FROM
road_segments AS r, venues AS v WHERE v.venue_id = 29 AND r.gid = 100982;

 st_intersects
---------------
 f
(1 row)

gis=# SELECT postgis_full_version();


postgis_full_version
----------------------------------------------------------------------------------------
 POSTGIS="1.4.1" GEOS="3.2.1-CAPI-1.6.1" PROJ="Rel. 4.7.1, 23 September
2009" USE_STATS
(1 row)



Any assistance would be much appreciated.

Thanks,

-Francis Markham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20100503/495537b4/attachment.html>


More information about the postgis-users mailing list