1

Update My question is a duplicate of Extracting centerline of a Complex-Polygon in PostGIS/Python (though if anyone has a programmatic solution - that is, not ArcGIS but rather Py, C, Java, etc. - I would be interested).

Let's say I have shape such as the below: enter image description here

From this shape, I want to perform a negative buffer that produces the following: enter image description here

The rough idea was to perform a negative buffer that exceeded the diameter of the geometry at any given point. This does not work, though, and leads to an empty geometry.

How might I perform a geometric operation on a shape so as to impute its centermost points? Is some form of negative buffering a reasonable approach? Or, is there a more well-word path to achieving the spline of such geometries?

Hornbydd
  • 43,380
  • 5
  • 41
  • 81
kuanb
  • 585
  • 2
  • 7
  • 18
  • 1
    check this function out https://postgis.net/docs/ST_ApproximateMedialAxis.html you will have to enable or create the SFCGAL extension to use it – ziggy Aug 14 '17 at 18:23
  • Awesome - thanks much!

    Any chance someone's already done the heavy lifting on implementing this in vanilla Python (aware it will be slower). Either way, this is the solution!

    – kuanb Aug 14 '17 at 18:46
  • i think the function comes from this library http://sfcgal.org/ – ziggy Aug 15 '17 at 13:12

1 Answers1

2

As commented by @ziggy:

check this function out https://postgis.net/docs/ST_ApproximateMedialAxis.html you will have to enable or create the SFCGAL extension to use it

and

i think the function comes from this library http://sfcgal.org/

PolyGeo
  • 65,136
  • 29
  • 109
  • 338