ST_Split

更新时间:
复制 MD 格式

Splits a geometry object and returns the result as a GeometryCollection.

Syntax

geometry ST_Split(geometry input, geometry blade)

Parameters

ParameterDescription
inputThe geometry object to split.
bladeThe geometry object used to split input.

Description

  • Splits a line object using a MultiPoint, MultiLine, or MultiPolygon object.

  • Splits a MultiPolygon object using a line object.

  • Always returns a GeometryCollection.

  • When blade is a MultiPolygon, the function splits input along the boundaries of the MultiPolygon.

  • Theoretically, applying ST_Union to the result of ST_Split returns the original input geometry.

Examples

The following example splits a Polygon using a LineString:

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