Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Returns true if the two geometries touch each other.
Syntax
st_touches ( geo1, geo2 )
Arguments
geo1
: The firstGEOMETRY
value.geo2
: The secondGEOMETRY
value.
Returns
A value of type BOOLEAN
, true if the two geometries touch each other.
The function returns NULL
if any of the inputs is NULL
.
Error conditions
- If any of the input geometries is a geometry collection, the function returns ST_INVALID_ARGUMENT_TYPE.
- If the input geometries do not have the same SRID value, the function returns ST_DIFFERENT_SRID_VALUES.
Examples
-- Returns false when geometries do not touch.
> SELECT st_touches(st_geomfromtext('LINESTRING(5 0,5 10)'),st_geomfromtext('MULTILINESTRING((0 0,10 10),(0 10,10 0))'))
false
-- Returns true when geometries touch.
> SELECT st_touches(st_geomfromtext('LINESTRING(5 0,5 5)'),st_geomfromtext('MULTILINESTRING((0 0,10 10),(0 10,10 0))'))
true