[gdal-dev] curve fit question

Mateusz Loskot mateusz at loskot.net
Mon Aug 11 14:04:06 EDT 2008


Clay, Bruce wrote:
> Does anyone know of a function in GDAL or related libraries that given a
> set of points it will return a new set of points that is or can be used
> to create a smoothed polyline?  I have heard about things like linear
> fit and least squares but I have not used them and I am quite rusty on
> the math used to calculate a smoothed line from a set of points.  I have
> done a lot of web searching and found various generic algorithms but I
> don't see how to apply them.  For example a linear regression sample
> takes in a set of X-Y points but it only returns 3 values of C and
> standard deviation. 

Bruce,

There are number of simplifiers available in GEOS

http://trac.osgeo.org/geos/

Some very poor-man solution is here :-)

http://mateusz.loskot.net/tmp/gdal/ogr_collinear_simplify.cpp.html

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the gdal-dev mailing list