org.jaitools.jts
Class LineSmoother
java.lang.Object
org.jaitools.jts.AbstractSmoother
org.jaitools.jts.LineSmoother
public class LineSmoother
- extends AbstractSmoother
Line smoothing by interpolation with cubic Bazier curves.
This code adapts an algorithm which was devised by Maxim Shemanarev
for polygons and described by him at:
http://www.antigrain.com/research/bezier_interpolation/index.html.
To use the same algorithm for LineStrings we add a dummy vertex to
either end, calculate control points for just the real vertices.
- Since:
- 1.1
- Version:
- $Id$
- Author:
- Michael Bedward
|
Constructor Summary |
LineSmoother()
Default constructor. |
LineSmoother(com.vividsolutions.jts.geom.GeometryFactory geomFactory)
Constructor. |
|
Method Summary |
com.vividsolutions.jts.geom.LineString |
smooth(com.vividsolutions.jts.geom.LineString ls,
double alpha)
Creates a new LineString which is a smoothed version of
the input LineString. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LineSmoother
public LineSmoother()
- Default constructor.
LineSmoother
public LineSmoother(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
smooth
public com.vividsolutions.jts.geom.LineString smooth(com.vividsolutions.jts.geom.LineString ls,
double alpha)
- Creates a new
LineString which is a smoothed version of
the input LineString.
- Parameters:
ls - the input LineStringalpha - a value between 0 and 1 (inclusive) specifying the tightness
of fit of the smoothed boundary (0 is loose)
- Returns:
- the smoothed
LineString
Copyright © 2009-2015. All Rights Reserved.