[GIS] Creating centerline of polygon using PostGIS

linepostgisshapefile

I am aware of Finding centrelines from polygons in QGIS? but I am looking for another Open Source GIS way to do this.

Is there a possibility to create centerlines in PostGIS?

I have this shapefile (see below) which contains different zones. I need a centerline in each zone – it may not be one line, it can be more (for example in brown zone).

In ArcGIS I can separate each zone as a new shapefile and then use ET Geowizard to create that lines.

Zones

Best Answer

PostGIS has ST_StraightSkeleton, which implements a polygon thinning algorithm:

ST_StraightSkeleton — Compute a straight skeleton from a geometry

Related Question