org.jaitools.jts
Class PolygonSmoother

java.lang.Object
  extended by org.jaitools.jts.AbstractSmoother
      extended by org.jaitools.jts.PolygonSmoother

public class PolygonSmoother
extends AbstractSmoother

Polygon smoothing by interpolation with cubic Bazier curves. This code implements an algorithm which was devised by Maxim Shemanarev and described by him at: http://www.antigrain.com/research/bezier_interpolation/index.html.

Note: the code here is not that written by Maxim to accompany his algorithm description. Rather, it is an original implementation and any errors are my fault.

Since:
1.1
Version:
$Id$
Author:
Michael Bedward

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jaitools.jts.AbstractSmoother
AbstractSmoother.InterpPoint
 
Field Summary
 
Fields inherited from class org.jaitools.jts.AbstractSmoother
control, DEFAULT_CONTROL, geomFactory, lookup
 
Constructor Summary
PolygonSmoother()
          Default constructor.
PolygonSmoother(com.vividsolutions.jts.geom.GeometryFactory geomFactory)
          Constructor.
 
Method Summary
 com.vividsolutions.jts.geom.Polygon smooth(com.vividsolutions.jts.geom.Polygon inputPoly, double alpha)
          Creates a new Polygon whose exterior shell is a smoothed version of the input Polygon.
 
Methods inherited from class org.jaitools.jts.AbstractSmoother
cubicBezier, getInterpPoints, setControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonSmoother

public PolygonSmoother()
Default constructor.


PolygonSmoother

public PolygonSmoother(com.vividsolutions.jts.geom.GeometryFactory geomFactory)
Constructor.

Parameters:
geomFactory - an instance of GeometryFactory to use when creating smoothed Geometry objects
Throws:
IllegalArgumentException - if geomFactory is null
Method Detail

smooth

public com.vividsolutions.jts.geom.Polygon smooth(com.vividsolutions.jts.geom.Polygon inputPoly,
                                                  double alpha)
Creates a new Polygon whose exterior shell is a smoothed version of the input Polygon.

Note: this method presently ignores holes.

Parameters:
inputPoly - the input Polygon
alpha - a value between 0 and 1 (inclusive) specifying the tightness of fit of the smoothed boundary (0 is loose)
Returns:
the smoothed Polygon


Copyright © 2009-2013. All Rights Reserved.