ST_Touches

Determine whether two geometries touch without their interiors intersecting, that is, whether their DE-9IM intersection matrix is FT*******, F**T*****, or F***T****.

All coordinate systems are treated as being Cartesian.

Syntax

ST_Touches(geo1, geo2);
geo1
The first input geometry.

Type: VARCHAR(ANY)

geo2
The second input geometry.

Type: VARCHAR(ANY)

Returns

A value of type BOOL that is TRUE if the two geometries touch without their interiors intersecting; otherwise FALSE.

Examples

SELECT inza..ST_Touches(inza..ST_WKTToSQL('LINESTRING (0 0, 10 10)'),
            inza..ST_WKTToSQL('LINESTRING (5 5, 11 11)'));
 
ST_TOUCHES
------------
f
(1 row)
 
SELECT inza..ST_Touches(inza..ST_WKTToSQL('LINESTRING (0 0, 10 10)'),
            inza..ST_WKTToSQL('LINESTRING (10 10, 11 11)'));
 
ST_TOUCHES
------------
t
(1 row)