Skip to content
πŸŽ‰ Apache Sedona 1.9.1 is out now! πŸ—ΊοΈ Geography SQL functions, Box2D & Box3D types, raster Python UDFs & more. Read the release notes β†’

ST_SubDivide

Introduction: Returns a multi-geometry divided based of given maximum number of vertices.

A minimum of 5 vertices is required for maxVertices parameter to form a closed box.

ST_SubDivide

Format: ST_SubDivide(geom: geometry, maxVertices: int)

Return type: Array<Geometry>

SQL example:

SELECT Sedona.ST_AsText(Sedona.ST_SubDivide(Sedona.ST_GeomFromText('LINESTRING(0 0, 85 85, 100 100, 120 120, 21 21, 10 10, 5 5)'), 5));

Output:

MULTILINESTRING ((0 0, 5 5), (5 5, 10 10), (10 10, 21 21), (21 21, 60 60), (60 60, 85 85), (85 85, 100 100), (100 100, 120 120))