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 are geometrically equal, meaning they correspond to the same point set.
Syntax
st_equals ( geo1, geo2 )
Arguments
geo1
: The firstGEOMETRY
value.geo2
: The secondGEOMETRY
value.
Returns
A value of type BOOLEAN
.
For more details on what it means for two geometries to be equal, see the Equals predicate in the DE-9IM matrix definition.
The function returns NULL
if any of the inputs is NULL
.
Error conditions
- If any of the two input geometries is a geometry collection, an error is returned.
- If the two input geometries have different SRID values, the function returns ST_DIFFERENT_SRID_VALUES.
Examples
-- Returns false as a point and polygon are not equal.
> SELECT st_equals(st_geomfromtext('POINT(1 1)'),st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'))
false
-- Returns true as the two polygons are geometrically equal.
> SELECT st_equals(st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'),st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'))
true