public class VWSimplifier extends Object
Geometry using the Visvalingam-Whyatt area-based 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.
The simplification tolerance is specified as a distance. This is converted to an area tolerance by squaring it.
Note that in general this algorithm 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.
| Constructor and Description |
|---|
VWSimplifier(Geometry
Creates a simplifier for a given geometry.
|
| Modifier and Type | Method and Description |
|---|---|
Geometry |
getResultGeometry()
Gets the simplified geometry.
|
void |
setDistanceTolerance(double distanceTolerance)
Sets the distance tolerance for the simplification.
|
void |
setEnsureValid(boolean isEnsureValidTopology)
Controls whether simplified polygons will be "fixed" to have valid topology.
|
static Geometry |
simplify(Geometry
Simplifies a geometry using a given tolerance.
|
public VWSimplifier(GeometryinputGeom)
inputGeom - the geometry to simplify
public static Geometrysimplify(Geometry geom, double distanceTolerance)
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)
isEnsureValidTopology -
public GeometrygetResultGeometry()