ST_Touches — Returns true if two geometries have at least one point in common, but their interiors do not intersect.
TRUE if A and B intersect,
but their interiors do not intersect. Equivalently, A and B have at least one point in common,
and the common points lie in the intersection of their boundaries.
For Point/Point inputs the relationship is always
since points do not have a boundary.
In mathematical terms, this relationship is expressed as:
This relationship holds if the DE-9IM Intersection Matrix for the two geometries matches one of:
This function automatically includes a bounding box comparison
that makes use of any spatial indexes that are available on the geometries.
To avoid using an index, use
Enhanced: 3.0.0 enabled support for
This method implements the OGC Simple Features Implementation Specification for SQL 1.1. s22.214.171.124 // s126.96.36.199
This method implements the SQL/MM specification. SQL-MM 3: 5.1.28
ST_Touches predicate returns
TRUE in all the following illustrations.
SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(1 1)'::geometry); st_touches ------------ f (1 row) SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(0 2)'::geometry); st_touches ------------ t (1 row)