[postgis-users] st_touches does not work with line/point real geometries
Martin Davis
mtnclimb at gmail.com
Thu Mar 21 11:07:27 PDT 2019
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].
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.
[1] https://en.wikipedia.org/wiki/DE-9IM#Spatial_predicates
On Thu, Mar 21, 2019 at 10:41 AM Eugene Podshivalov <yaugenka at gmail.com>
wrote:
> Hi all,
> I would like to report an issue on st_touches function.
>
> The example from the documentation works fine:
> =# select ST_Touches('LINESTRING(0 0, 10 0)'::geometry, 'POINT(0
> 0)'::geometry);
> st_touches
> ------------
> t
>
> It works fine with real line-to-line geometries as well:
> =# select *st_touches(a.geom,b.geom)* 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);
> st_touches
> ------------
> t
>
> But it won't work in the following case:
> =# select *st_touches(a.geom,st_endpoint(b.geom))* 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);
> st_touches
> ------------
> f
>
> Cheers,
> Eugene
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190321/ca9c883e/attachment.html>
More information about the postgis-users
mailing list