Update of "About ST_Subdivide()"
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: d7e14cd8a2a43e43aa2da8bc53be3464964753f7
Page Name:About ST_Subdivide()
Date: 2019-02-15 10:44:43
Original User: sandro
Next fc842978ba0d7b9506859f68d4e4e2db8628dc3a
Content

ST_Subdivide(): a quick intro

back to index

About ST_Subdivide()

Since version 5.0.0 SpatiaLite supports ST_Subdivide(), an advanced SQL function already available on PostGIS.
The implementation is strictly similar in both Spatial DBMSes because on PostgIS the function is built on the top of the internal lwgeom library, and on SpatiaLite is built on the top of librttopo that simply is a more universal porting of lwgeom outside PostGIS.

A short rationale: processing huge geometries having an impressive number of Vertices (many thousands or even more) is an intrinsically slow process.
Subdividing them into many smaller parts (still preserving full topological consistency) usually helps to restore a satisfying processing speed. This is exactly the intended scope of ST_Subdivide():
  • this function will receive an input geometry (may well be a very huge one).
  • each Linestring or Polygon found within the input geometry will be then processed:
    • all Linestrings or Polygons using a number of Vertices lesser or equal than the given threshold will be returned as they are.
    • but all Linestrings or Polygons using an exceeding number of Vertices will be recursively split, untill they'll be represented by a collection of elementary parts using no more than the required number of vertices.
  • at the end of the process the function will return a collection containing all elementary parts (a MultiLinestring or a MultiPolygon depending on the nature of the input geometry).


back to index