<div dir="ltr"><div dir="ltr">All the test cases provided have correct results.  In the third case, the "touches" predicate has the correct result FALSE.  This is because "touches" requires that the two geometries have no interior points in common [1].  </div><div dir="ltr"><br></div><div dir="ltr">In the test case one of the geometries is a POINT, which by definition is an interior point.  The point intersects an interior vertex of the LINESTRING, and thus "touches" evaluates to false.<div><br></div><div>[1] <a href="https://en.wikipedia.org/wiki/DE-9IM#Spatial_predicates">https://en.wikipedia.org/wiki/DE-9IM#Spatial_predicates</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 21, 2019 at 10:41 AM Eugene Podshivalov <<a href="mailto:yaugenka@gmail.com">yaugenka@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi all,<div>I would like to report an issue on st_touches function.</div><div><br></div><div>The example from the documentation works fine:</div><div><div>=# select ST_Touches('LINESTRING(0 0, 10 0)'::geometry, 'POINT(0 0)'::geometry);</div><div> st_touches</div><div>------------</div><div> t</div></div><div><br></div><div>It works fine with real line-to-line geometries as well:</div><div><div>=# select <b>st_touches(a.geom,b.geom)</b> from st_geomfromewkt('SRID=4326;LINESTRING(28.9019278 53.8056134,28.901969 53.804671,28.90144 53.8017222)') as a (geom), st_geomfromewkt('SRID=4326;LINESTRING(28.896058 53.8047031,28.901969 53.804671)') as b (geom);</div><div> st_touches</div><div>------------</div><div> t</div></div><div><br></div><div>But it won't work in the following case:</div><div><div>=# select <b>st_touches(a.geom,st_endpoint(b.geom))</b> from st_geomfromewkt('SRID=4326;LINESTRING(28.9019278 53.8056134,28.901969 53.804671,28.90144 53.8017222)') as a (geom), st_geomfromewkt('SRID=4326;LINESTRING(28.896058 53.8047031,28.901969 53.804671)') as b (geom);</div><div> st_touches</div><div>------------</div><div> f</div></div><div><br></div><div>Cheers,</div><div>Eugene</div></div></div></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="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>