<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">There are two issues here.  <br><br>I believe ST_AsText() does not return the full underlying precision of the point/line coordinates, so won't help resolve this.<br><br>Also, if you bear in mind your machine precision (or the Postgis coordinate precision - which may not be the same thing), the number of points on a linestring is finite, and makes the linestring actually a series of small steps. Think of it a bit like a series of pixels in a very fine raster. If horizontal or vertical, it works nicely, but any sort of diagonal & your line is only approximated. Two crossing diagonals do not necessarily have a pixel (point) in common.<br><br>A point using the value of pi as a coordinate - you can get very close, but "equals" is a meaningless operation.<br><br>Point on line intersections are therefore real number equality tests, and not reliable. Theoretically
 you can get different answers on 32/64 bit systems, or code compiled with different compilers (with different numerical precision), & if you export to any format that has reduced precision coordinates & re-import you can change the result as well. <br><br>This also applies to points very nearly "on" the boundary of a polygon being inside or outside.<br><br>This is an issue for me using postgis topologies. Creating nodes (as points) at the intersections of linestrings can result in very slightly shifted linestrings - not quite the same as the originals.<br><br>For point-on-line queries, using ST_Within() & a near zero number will find points very nearly on a line, there is no operation that can measure this exactly.<br><br>Cheers,<br><br>   Brent Wood<br><br>--- On <b>Sat, 5/18/13, Richard Cernava <i><cernava@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px;
 padding-left: 5px;"><br>From: Richard Cernava <cernava@gmail.com><br>Subject: [postgis-users] Strange behavior<br>To: postgis-users@lists.osgeo.org<br>Date: Saturday, May 18, 2013, 11:40 AM<br><br><div id="yiv1712282073"><div dir="ltr">I'm trying to query if a point is present inside a MultiLineString. When I run the following query I get very strange results in my opinion. If someone could elaborate as to what's going on it would be very much appreciated! <div>
<br></div><div>From this query I get a false and a true on the identical data. First I check to see if the_geom intersects with my point and receive false. Second I take the_geom and convert it to text and then compare it with my point using ST_GeomFromText and get true. How is this possible? I've outputted the result from the statement below.<br>
<div><br></div><div><div><div>SELECT fullname, ST_X(ST_StartPoint(ST_LineMerge(the_geom))), ST_Y(ST_StartPoint(ST_LineMerge(the_geom))),</div><div>ST_AsText(the_geom) AS text,</div><div>ST_Intersects(the_geom, ST_GeomFromText('POINT(-122.837109 45.537746)', 4269)) AS fromdb,</div>
<div>ST_Intersects(ST_GeomFromText(ST_AsText(the_geom), 4269), ST_GeomFromText('POINT(-122.837109 45.537746)', 4269)) AS fromtxt</div><div>from tiger_data.or_edges where   fullname like 'NW Norwich St' limit 1</div>
<div><br></div></div><div><br></div><div>"NW Norwich St";-122.837109;45.537746;"MULTILINESTRING((-122.837109 45.537746,-122.837253 45.537684,-122.837718 45.537368,-122.837829 45.537288,-122.838081 45.537108,-122.838169 45.537049))";f;t<br>
</div><div><br></div><div><br></div>-- <br>-Richard
</div></div></div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@lists.osgeo.org" href="/mc/compose?to=postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></div></blockquote></td></tr></table>