public class DouglasPeuckerSimplifier extends Object
Geometryusing the Douglas-Peucker algorithm. Ensures that any polygonal geometries returned are valid. Simple lines are not guaranteed to remain simple after simplification. All geometry types are handled. Empty and point geometries are returned unchanged. Empty geometry components are deleted.
Note that in general D-P does not preserve topology -
e.g. polygons can be split, collapse to lines or disappear
holes can be created or disappear,
and lines can cross.
To simplify geometry while preserving topology use
(However, using D-P is significantly faster).
|Constructor and Description|
Creates a simplifier for a given geometry.
|Modifier and Type||Method and Description|
Gets the simplified geometry.
Sets the distance tolerance for the simplification.
Controls whether simplified polygons will be "fixed" to have valid topology.
Simplifies a geometry using a given tolerance.
public DouglasPeuckerSimplifier(Geometry inputGeom)
inputGeom- the geometry to simplify
geom- geometry to simplify
distanceTolerance- the tolerance to use
public void setDistanceTolerance(double distanceTolerance)
distanceTolerance- the approximation tolerance to use
public void setEnsureValid(boolean isEnsureValidTopology)
public Geometry getResultGeometry()
Copyright © 2016. All rights reserved.