[postgis-devel] smoothing function Chaikins algorithm

Nicklas Avén nicklas.aven at jordogskog.no
Fri Mar 9 02:03:09 PST 2018


Hello

I have implemented chiakins algorithm for smoothing geometries.

http://idav.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins
-Algorithm.html

The algorithm is amazing simple

Signature is:

st_chaikins(geom geometry, n_iterations int, preserve_endpoints
boolean)

Do we want it in PostGIS?

Should it be a more describing name than st_chaikins?

The function more or less doubles the number of vertex points per
iteration, so I have to put in a max number of iterations. I tried it
with 40 iterations without thinking about it and it of course crashed
the server :-)

It can be combined with some simplify function to again reduce number
of verteces.

The use case here is geometries generated from raster to smooth out the
pixels.

I have some cleanup to do before putting it somewhere.

Thanks

Nicklas


More information about the postgis-devel mailing list