[postgis-users] st_touches does not work with line/point real geometries

Martin Davis mtnclimb at gmail.com
Thu Mar 21 11:47:32 PDT 2019

On Thu, Mar 21, 2019 at 11:29 AM Eugene Podshivalov <yaugenka at gmail.com>

> If non-end points of a LINE are considered interior then the second case
> should evaluate to false
As Sandro said, Touches is TRUE iff  the only points in common between g1
and g2 lie in the union of the boundaries of g1 and g2.

Equivalently, Touches is TRUE iff the geometries have at least one point in
common, but their interiors do not intersect.

In the second case:

A = LINESTRING (28.9019278 53.8056134, 28.901969 53.804671, 28.90144
B = LINESTRING (28.896058 53.8047031, 28.901969 53.804671)

A touches B = TRUE because the single point of intersection lies in the
boundary of A (it is an endpoint of the LineString).  Thus their interiors
do not intersect.

> and if a POINT is an interior by itself then any area-to-point comparisons
> should evaluate to false also, shoudn't they?

No, if the point lies on the boundary of the area then touches = TRUE,
because the interiors do not intersect.  (As shown in the diagram on
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190321/1f344ae1/attachment.html>

More information about the postgis-users mailing list