ST_Split
Updated at:
Splits a geometry into parts using a blade geometry and returns the result as a GeometryCollection.
Syntax
geometry ST_Split(geometry input, geometry blade);Parameters
| Parameter | Description |
|---|---|
input | The geometry object to split. |
blade | The geometry object used to cut input. |
Description
ST_Split supports the following input/blade combinations:
Splitting a line using a MultiPoint, MultiLine, or MultiPolygon object.
Splitting a MultiPolygon using a line object.
The function always returns a GeometryCollection. Applying ST_Union to the result theoretically reconstructs the original input geometry.
When blade is a MultiPolygon, the split uses the boundaries of the MultiPolygon, not its interior area.
Examples
Split a polygon by a line
SELECT blade,
ST_Split(input, blade)
FROM (
SELECT ST_MakeEnvelope(0, 0, 2, 2) AS input,
'LINESTRING(1 -1, 1 3)'::geometry AS blade
) AS t;
Is this page helpful?