static class DouglasPeuckerSimplifier.DPTransformer extends GeometryTransformer
Modifier and Type | Field and Description |
---|---|
private double |
distanceTolerance |
private boolean |
isEnsureValidTopology |
factory
Constructor and Description |
---|
DPTransformer(boolean isEnsureValidTopology,
double distanceTolerance) |
Modifier and Type | Method and Description |
---|---|
private Geometry |
createValidArea(Geometry rawAreaGeom)
Creates a valid area geometry from one that possibly has
bad topology (i.e.
|
protected CoordinateSequence |
transformCoordinates(CoordinateSequence coords,
Geometry parent)
Transforms a
CoordinateSequence . |
protected Geometry |
transformLinearRing(LinearRing geom,
Geometry parent)
Simplifies a LinearRing.
|
protected Geometry |
transformMultiPolygon(MultiPolygon geom,
Geometry parent)
Simplifies a MultiPolygon, fixing it if required.
|
protected Geometry |
transformPolygon(Polygon geom,
Geometry parent)
Simplifies a polygon, fixing it if required.
|
copy, createCoordinateSequence, getInputGeometry, transform, transformGeometryCollection, transformLineString, transformMultiLineString, transformMultiPoint, transformPoint
private boolean isEnsureValidTopology
private double distanceTolerance
public DPTransformer(boolean isEnsureValidTopology, double distanceTolerance)
protected CoordinateSequence transformCoordinates(CoordinateSequence coords, Geometry parent)
GeometryTransformer
CoordinateSequence
.
This method should always return a valid coordinate list for
the desired result type. (E.g. a coordinate list for a LineString
must have 0 or at least 2 points).
If this is not possible, return an empty sequence -
this will be pruned out.transformCoordinates
in class GeometryTransformer
coords
- the coordinates to transformparent
- the parent geometryprotected Geometry transformPolygon(Polygon geom, Geometry parent)
transformPolygon
in class GeometryTransformer
protected Geometry transformLinearRing(LinearRing geom, Geometry parent)
transformLinearRing
in class GeometryTransformer
geom
- the ring to simplifyparent
- the parent geometryprotected Geometry transformMultiPolygon(MultiPolygon geom, Geometry parent)
transformMultiPolygon
in class GeometryTransformer
private Geometry createValidArea(Geometry rawAreaGeom)
rawAreaGeom
- an area geometry possibly containing self-intersections