[mapserver-users] distance of a point from a multistring line

Suman Chatterjee schatterjee at addisontx.gov
Thu Sep 17 11:42:33 EDT 2009


Hi,

I am having a table in which I am storing a MULTISTRING after applying
ST_union on a set of multistring data which are continuous. This is
actually the shortest path that I am determining.

Now, I am capturing real time gps coordinates. My plan is that when the
gps position deviates from the determined route it will calculate the
shortest path again from the GPS position.

So I am trying to find the distance of the GPS point from the line (
representing the shortest path) as follows:

 

Select
ST_Distance(gpsdata.gpscoords,ST_line_interpolate_point(shortpath.the_ge
om,ST_line_locate_point(ST_LineMerge(shortpath.the_geom),
GeomFromText('POINT(2477850.34  7044705.10)',2276))) from
gpsdata,shortpath where shortpath.gid=1 and gpsdata.oid=2

 

The coordinates are that of one such gps point.

But I am getting error in the ST_line_locate_point . It says

 

Line_locate_point: 1st arg isn't a line.

 

But when I am running the line_locate_point with some different table
like roads table it works fine.

 

So is there any other way to find the distance of a point to a line?

Thanks

Suman


*******************************************************************************************************************
This e-mail and any files or attachments transmitted with it contains Information that is confidential and privileged. This document may contain Protected Health Information (PHI) or other information that is intended only for the use of the individual(s) and entity(ies) to whom it is addressed. If you are the intended recipient, further disclosures are prohibited without proper authorization. If you are not the intended recipient, any disclosure, copying, printing, or use of this information is strictly prohibited and possibly a violation of federal or state law and regulations. If you have received this information in error, please delete it and notify Hamid Khaleghipour at 972-450-2868 immediately. Thank you.

*******************************************************************************************************************


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090917/aeb11929/attachment-0001.html


More information about the mapserver-users mailing list