This topic describes the ST_Split function. This function returns a GeometryCollection object by splitting the input geometry object.

Syntax

geometry  ST_Split(geometry  input , geometry  blade);

Parameters

Parameter Description
input The geometry object that you want to specify.
blade The geometry object that you use to split the input geometry object.

Description

  • This function can split a line object by using a MultiPoint object, MultiLine object, or MultiPolygon object. This function can also split a MultiPolygon object by using a line object.
  • This function always returns a GeometryCollection object.
  • Theoretically, if you use the ST_Union function to process the result returned by the ST_Split function, the ST_Union function returns the input geometry object of the ST_Split function.
  • If you set the blade parameter to a MultiPolygon object, this function splits the input geometry object by using the boundaries of the MultiPolygon object.

Examples

Execute the following statements to split a polygon object by using a LineString object:
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;
1