Name

ST_Segmentize — Splits a segment of a geometry if it is shorter than a given maximum Length. The distance is computed only in 2D.

Synopsis

geometry ST_Segmentize(bytea Geometry, double MaxLength);

Alias

Segmentize

Description

Splits a segment of a geometry if it is shorter than a given maximum Length. The distance is computed only in 2D.

[Note]

GeometryCollection supported

Coordinate Dimensions
2D3DM
Spatial Standards Support
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
----

Examples

SELECT ST_AsEWKT(ST_Segmentize(ST_GeomFromEWKT('LINESTRING (0 0 2, 0 10 4)'),5));
--Result
LINESTRING (0 0 2, 0 5 3, 0 10 4)

SELECT ST_AsEWKT(ST_Segmentize(ST_GeomFromEWKT('POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'),8));
--Result
POLYGON ((0 0, 0 8, 0 10, 8 10, 10 10, 10 2, 10 0, 2 0, 0 0))

Related functions

ST_Line_Substring