<div dir="ltr"><div>The 0.00001 value is in your coordinate system units. From your example it's probably degrees and not meters.<br><br></div>Alexandre Neto<br><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Em qua, 30 de set de 2015 às 13:29, Dharshan Bharathur <<a href="mailto:dharshan4help@gmail.com">dharshan4help@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks for the reply,<br><br>Yes, I tried with ST_DWithin and it is working fine now. <br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">But then, according to doc "closest point on LineString to the given Point" is wrong statement right?<br><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">And in "ST_DWithin(line,<br>
point, 0.00001)" , 0.000001 is in meter? what is the least /last value we can use?<br><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><font face="courier new, monospace"><b>Thanks & Regards</b></font></div></div></div></div><div class="gmail_extra"><div><div><div dir="ltr"><font face="courier new, monospace"><b><br>Dharshan<br></b></font></div></div></div></div><div class="gmail_extra">
<br><div class="gmail_quote">On Wed, Sep 30, 2015 at 5:54 PM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Unfortunately, due to the vagaries of the IEEE double precision grid,<br>
your constructed point probably does not like *exactly* on your line,<br>
but ever-so-slightly off. Try testing instead for ST_DWithin(line,<br>
point, 0.00001) or something and it should work better.<br>
<br>
P<br>
<div><div><br>
On Tue, Sep 29, 2015 at 9:59 PM, Dharshan Bharathur<br>
<<a href="mailto:dharshan4help@gmail.com" target="_blank">dharshan4help@gmail.com</a>> wrote:<br>
> Hi all, Need experts advice.<br>
><br>
> This is the same question I have asked here.<br>
><br>
> I am using postgis's ST_LineLocatePoint to find out the closest point on a<br>
> LineString to the given Point, and using  ST_LineInterpolatePoint to extract<br>
> a Point from the returned float number.(as referred here)<br>
><br>
> This is my ST_LineLocatePoint Query<br>
><br>
> SELECT ST_AsText(ST_LineInterpolatePoint(foo.the_line,<br>
>          ST_LineLocatePoint(foo.the_line,ST_GeomFromText('POINT(12.962315<br>
>          77.584841)')))) AS g FROM (SELECT<br>
> ST_GeomFromText('LINESTRING(12.96145<br>
>          77.58408,12.96219 77.58447,12.96302 77.58489,12.96316<br>
> 77.58496,12.96348<br>
>          77.58511)') AS the_line) AS foo;<br>
><br>
><br>
> Output:<br>
><br>
>                   g<br>
> ------------------------------------------<br>
>  POINT(12.9624389808159 77.5845959902924)<br>
><br>
> Which exactly lies on the linestring I have passed. Demonstration is<br>
> displayed here.<br>
><br>
><br>
> query with St_Closest function also returns the same points.<br>
><br>
> But when I check whether this point lies in the same linestring using<br>
> ST_Contains it always return false, even though the point lies within.<br>
><br>
> My ST_Contains Query:<br>
><br>
> SELECT ST_Contains(ST_GeomFromText('LINESTRING(12.96145 77.58408,12.96219<br>
> 77.58447,12.96302 77.58489, 12.96316 77.58496, 12.96348<br>
> 77.58511)'),ST_GeomFromText('POINT(12.9624389808159 77.5845959902924)'));<br>
><br>
> Output:<br>
><br>
> st_contains<br>
> -------------<br>
> f<br>
><br>
> I am not getting where I am doing wrong, why I am getting false. Can anyone<br>
> help me in this.<br>
><br>
><br>
> I am using Postgresql : 9.4, postgis : 2.1<br>
><br>
><br>
><br>
><br>
> Thanks & Regards<br>
> Dharshan<br>
><br>
</div></div>> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></blockquote></div>