ST_Intersection — Returns a 2D geometric object that represents the intersection of two geometric objects.
geometry ST_Intersection(
bytea GeomA, bytea GeomB)
;
Returns a geometric object that represents the intersection of two geometric objects.
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.3 | 7.2.21.1 | 7.2.8.1 | 5.1.18 |
--2D Geometries SELECT ST_astext(ST_Intersection ( st_geomfromtext('POLYGON ((1 3, 1 8, 6 8, 6 3, 1 3))') , st_geomfromtext('MULTIPOLYGON (((6 8, 6 10, 8 10, 8 8, 6 8)),((6 3, 6 6, 10 6, 10 3, 6 3)))'))); --Result GEOMETRYCOLLECTION (POINT (6 8), LINESTRING (6 6, 6 3)) --3D Geometries SELECT ST_astext(ST_Intersection ( st_geomfromtext('POLYGON ((1 3 2, 1 8 4, 6 8 6, 6 3 4, 1 3 2))') , st_geomfromtext('LINESTRING (4 2 3, 2 4 5, 4 9 6, 4 10 7)'))); --Result LINESTRING (3 3, 2 4, 3.6 8)
Geom A, GeomB | ST_Intersection (GeomA,GeomB) |
Geom A, GeomB | ST_Intersection (GeomA,GeomB) |