VWSimplifier class

Simplifies a {@link 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.

Known Bugs

  • Not yet optimized for performance
  • Does not simplify the endpoint of rings

To Do

  • Allow specifying desired number of vertices in the output

@version 1.7

Constructors

VWSimplifier(Geometry inputGeom)
Creates a simplifier for a given geometry.

Properties

hashCode int
The hash code for this object.
no setterinherited
inputGeom Geometry
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getResultGeometry() Geometry
Gets the simplified geometry.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDistanceTolerance(double distanceTolerance) → void
Sets the distance tolerance for the simplification. All vertices in the simplified geometry will be within this distance of the original geometry. The tolerance value must be non-negative.
setEnsureValid(bool isEnsureValidTopology) → void
Controls whether simplified polygons will be "fixed" to have valid topology. The caller may choose to disable this because:
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

simplify(Geometry geom, double distanceTolerance) Geometry
Simplifies a geometry using a given tolerance.