Functions / PostGIS / ST_Split
PostGISOverlay

ST_Split

What is ST_Split?

ST_Split splits an input geometry by a cutting geometry (a blade) and returns the resulting pieces as a GEOMETRYCOLLECTION. A polygon is split by a line into polygon pieces; a line is split by a point or by another line into line pieces.

SQL
ST_Split(geometry input, geometry blade)geometry

Supported input/blade combinations include: LINE split by POINT or LINE, POLYGON / MULTIPOLYGON split by LINE, and LINE split by MULTIPOINT.

When would you use ST_Split?

Use ST_Split to cut features at known locations: splitting a parcel polygon along a new road centreline, dividing a pipeline at valve points, or segmenting roads at intersections prior to routing. It is the standard tool for "cut here" operations without computing a full overlay.

SQL
1-- Split a parcel polygon along a proposed road alignment
2SELECT (ST_Dump(ST_Split(p.geom, r.geom))).geom AS piece
3FROM parcels p, proposed_roads r
4WHERE p.id = 42 AND ST_Intersects(p.geom, r.geom);

FAQs

What if the blade does not actually split the input?

If the blade does not cut through the input (for example a line that misses a polygon interior), ST_Split returns the input unchanged wrapped in a GEOMETRYCOLLECTION. Check the resulting piece count with ST_NumGeometries.

Can I split a polygon with a point?

No. A point has no dimension and cannot divide a polygon. To split a polygon use a LINESTRING or MULTILINESTRING blade that actually crosses the polygon.

How do I get the pieces as rows?

Use ST_Dump on the output: (ST_Dump(ST_Split(input, blade))).geom yields one row per piece, which is usually what you want for follow-on processing.

Does it handle Z and M values?

Z values on the input are preserved for polygon splits; for line splits, the split point's Z is interpolated between adjacent vertices. M values are handled similarly but can be unreliable near exact crossings — validate carefully if you depend on M.