ST_EQUALS()
All functions > GEOSPATIAL > ST_EQUALS()
Returns TRUE if two geometries or geographies represent the same point set.
Signatures
Spatial equality
Returns: TRUE if A and B are spatially equal
ST_EQUALS(geo1: T, geo2: T) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
geo1 | T | Yes | First geometry or geography |
geo2 | T | Yes | Second geometry or geography |
With:
T: Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY | GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY
Signature notes:
- Tests spatial equality, not binary equality; two geometries with different vertex orderings can be equal
- Both inputs must be the same type family
- Returns NULL if either input is NULL
Examples
FeatureQL
SELECT
f1 := ST_EQUALS(ST_GEOMPOINT(1.0, 2.0), ST_GEOMPOINT(1.0, 2.0)), -- Identical points
f2 := ST_EQUALS(ST_GEOMPOINT(1.0, 2.0), ST_GEOMPOINT(3.0, 4.0)) -- Different points
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
On this page