Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Can anyone provide an example SQL for smoothing linestrings from postgis table using Bezier curves or Iterative Averaging (SIA) algorithm?

share|improve this question

2 Answers 2

This is still an open issue in PostGIS (and other GIS tools) as stated in the book "PostGIS in Action" in chapter 2.2.6 "Curved geometries".

Here are some references to algorithms and code:

share|improve this answer
    
I added the postgis.17.x6... links –  martin f Oct 29 '13 at 22:09

You can try to convert your linestrings to curves with ST_LineToCurve and then back to linestrings with ST_CurveToLine.

You can set the number of segments per quarter circle you want in ST_CurveToLine.

share|improve this answer
    
LineToCurve is built to handing the outputs of CurveToLine, not to extract curves from arbitrary input. –  Paul Ramsey Sep 3 '13 at 19:31
    
@PaulRamsey would bezier smoothing be added in next Postgis versions? I've been thinking on something like this for instance: webhelp.esri.com/arcgisdesktop/9.2/… –  Gery Jan 2 at 10:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.