Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » SQL Anywhere Server - Spatial Data Support » Spatial types and functions » ST_Geometry type

ST_Touches method

Tests if a geometry value spatially touches another geometry value.

Syntax
geometry-expression.ST_Touches(geo2)
Parameters
Name Type Description

geo2

ST_Geometry

The other geometry value that is to be compared to the geometry-expression.

Returns
  • BIT

    Returns 1 if the geometry-expression touches geo2, otherwise 0. Returns NULL if both geometry-expression and geo2 have dimension 0.

Remarks

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 cannot be used with geometries in round-Earth spatial reference systems.
Standards
  • SQL/MM (ISO/IEC 13249-3: 2006)

    5.1.28

Example

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