ST_SymDifference — Returns a Geometry object that represents the point set symmetric difference of two Geometry objects.
geometry ST_SymDifference(
bytea GeomA, bytea GeomB)
;
Returns a Geometry object that represents the point set symmetric difference of two Geometry objects. The symmetric difference is a set combining the points in both Geometries that do not intersect.
This method does not support GeometryCollections |
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.3 | 7.2.21.1 | 7.2.8.1 | 5.1.21 |
SELECT ST_AsEWKT(ST_SymDifference(A,B)) from (SELECT ST_GeomFromText('POLYGON ((40 20, 40 100, 120 100, 120 20, 40 20))',25830) as A, ST_GeomFromText('POLYGON ((80 60, 80 130, 170 130, 170 60, 80 60))',25830) as B) as foo; --Result SRID=25830;MULTIPOLYGON (((40 20, 40 100, 80 100, 80 60, 120 60, 120 20, 40 20)),((120 60, 120 100, 80 100, 80 130, 170 130, 170 60, 120 60)))
A,B | ST_SymDifference (A,B) |