Tests if a geometry value spatially touches another geometry value. Two geometries spatially touch if their interiors do not
intersect but one or more boundary points from one value intersects the interior or boundary of the other value.
Note
If the geometry-expression contains circularstrings, then these are interpolated to line strings.
Note
This method can not be used with geometries in round-Earth spatial reference system.
The following example returns NULL because both inputs are points and have no boundary.
SELECT NEW ST_Point(1,1).ST_Touches( NEW ST_Point( 1,1 ) )
The following example lists the ShapeIDs of the geometries that touch the "Lighting Bolt" shape, which has ShapeID 6. This
example returns the result 5,16,26. Each of the three touching geometries intersect the Lighting Bolt only at its boundary.
SELECT List( ShapeID ORDER BY ShapeID )
FROM SpatialShapes
WHERE Shape.ST_Touches( ( SELECT Shape FROM SpatialShapes WHERE ShapeID = 6 ) ) = 1