<html>

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi,</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>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.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>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 </span></font><font size=2 face=Arial><span
 style='font-size:10.0pt;font-family:Arial'>GPS</span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'> position.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>So I am trying to find the distance of the </span></font><font
 size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>GPS</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> point from
the line ( representing the shortest path) as follows:</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Select ST_Distance(gpsdata.gpscoords,ST_line_interpolate_point(shortpath.the_geom,ST_line_locate_point(ST_LineMerge(shortpath.the_geom),
GeomFromText(&#8216;POINT(2477850.34&nbsp; 7044705.10)&#8217;,2276))) from gpsdata,shortpath
where shortpath.gid=1 and gpsdata.oid=2</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The coordinates are that of one such gps point.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>But I am getting error in the ST_line_locate_point . It says</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Line_locate_point: 1<sup>st</sup> arg isn&#8217;t a line.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>But when I am running the line_locate_point with some
different table like roads table it works fine.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>So is there any other way to find the distance of a point to
a line?</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Suman</span></font></p>

</div>


<P STYLE="margin-top: 0pt;margin-bottom: 0pt;"><SPAN STYLE="FONT-FAMILY:'Arial';FONT-SIZE:8pt;">******************************************************************************************************************* </SPAN></P>
<P STYLE="margin-top: 0pt;margin-bottom: 0pt;"><SPAN STYLE="FONT-FAMILY:'Arial';FONT-SIZE:8pt;">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. </SPAN></P>
<P STYLE="margin-top: 0pt;margin-bottom: 0pt;"><SPAN STYLE="FONT-FAMILY:'Arial';FONT-SIZE:8pt;"> </SPAN></P>
<P STYLE="margin-top: 0pt;margin-bottom: 0pt;"><SPAN STYLE="FONT-FAMILY:'Arial';FONT-SIZE:8pt;">******************************************************************************************************************* </SPAN></P>
<P STYLE="margin-top: 0pt;margin-bottom: 0pt;"><SPAN STYLE="FONT-FAMILY:'Arial';FONT-SIZE:8pt;"> </SPAN></P>
</body>

</html>