ST_Equals — Tests if a Geometry is spatially equal to another Geometry, returns True if so.
boolean ST_Equals(
bytea GeomA, bytea GeomB)
;
Tests if a Geometry is spatially equal to another Geometry, returns True if so.
The DE-9IM Intersection Matrix for the two geometries is T*F**FFF*
Note that this method computes topologically equality, not structural or vertex-wise equality (use ST_OrderingEquals for that).
GeometryCollections are unsupported |
2D | 3D | M |
---|---|---|
- | - |
OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
---|---|---|---|
2.1.1.2 , 2.1.13.3 | 7.2.19.1 | 7.2.8.1 | 5.1.24 |
SELECT ST_Equals(ga,gb) from (SELECT ST_GeomFromText('LINESTRING (0 0, 10 10, 10 5, 15 10)') as ga, ST_GeomFromText('LINESTRING (15 10, 10 5, 10 10, 5 5, 0 0)') as gb) as foo; --Result TRUE SELECT ST_Equals(ga,gb) from (SELECT ST_GeomFromText('LINESTRING (0 0 8, 10 10 2)') as ga, ST_GeomFromText('LINESTRING (10 10 4, 0 0 2)') as gb) as foo; --Result TRUE