public class Densifier
extends java.lang.Object
Geometry
by inserting extra vertices along the line segments
contained in the geometry.
All segments in the created densified geometry will be no longer than
than the given distance tolerance.
Densified polygonal geometries are guaranteed to be topologically correct.
The coordinates created during densification respect the input geometry's
PrecisionModel
.
Note: At some future point this class will offer a variety of densification strategies.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Densifier.DensifyTransformer |
Modifier and Type | Field and Description |
---|---|
private double |
distanceTolerance |
private Geometry |
inputGeom |
Constructor and Description |
---|
Densifier(Geometry inputGeom)
Creates a new densifier instance.
|
Modifier and Type | Method and Description |
---|---|
static Geometry |
densify(Geometry geom,
double distanceTolerance)
Densifies a geometry using a given distance tolerance,
and respecting the input geometry's
PrecisionModel . |
private static Coordinate[] |
densifyPoints(Coordinate[] pts,
double distanceTolerance,
PrecisionModel precModel)
Densifies a coordinate sequence.
|
Geometry |
getResultGeometry()
Gets the densified geometry.
|
void |
setDistanceTolerance(double distanceTolerance)
Sets the distance tolerance for the densification.
|
private Geometry inputGeom
private double distanceTolerance
public Densifier(Geometry inputGeom)
inputGeom
- public static Geometry densify(Geometry geom, double distanceTolerance)
PrecisionModel
.geom
- the geometry to densifydistanceTolerance
- the distance tolerance to densifyprivate static Coordinate[] densifyPoints(Coordinate[] pts, double distanceTolerance, PrecisionModel precModel)
pts
- distanceTolerance
- public void setDistanceTolerance(double distanceTolerance)
distanceTolerance
- the densification tolerance to usepublic Geometry getResultGeometry()