Package org.locationtech.jts.precision
Class CoordinatePrecisionReducerFilter
java.lang.Object
org.locationtech.jts.precision.CoordinatePrecisionReducerFilter
- All Implemented Interfaces:
CoordinateSequenceFilter
Reduces the precision of the
Coordinate
s in a
CoordinateSequence
to match the supplied PrecisionModel
.
Uses PrecisionModel.makePrecise(double)
.
The input is modified in-place, so
it should be cloned beforehand if the
original should not be modified.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCoordinatePrecisionReducerFilter
(PrecisionModel precModel) Creates a new precision reducer filter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
filter
(CoordinateSequence seq, int i) Rounds the Coordinates in the sequence to match the PrecisionModelboolean
isDone()
Always runs over all geometry components.boolean
Always reports that the geometry has changed
-
Field Details
-
precModel
-
-
Constructor Details
-
CoordinatePrecisionReducerFilter
Creates a new precision reducer filter.- Parameters:
precModel
- the PrecisionModel to use
-
-
Method Details
-
filter
Rounds the Coordinates in the sequence to match the PrecisionModel- Specified by:
filter
in interfaceCoordinateSequenceFilter
- Parameters:
seq
- theCoordinateSequence
to which the filter is appliedi
- the index of the coordinate to apply the filter to
-
isDone
public boolean isDone()Always runs over all geometry components.- Specified by:
isDone
in interfaceCoordinateSequenceFilter
- Returns:
- false
-
isGeometryChanged
public boolean isGeometryChanged()Always reports that the geometry has changed- Specified by:
isGeometryChanged
in interfaceCoordinateSequenceFilter
- Returns:
- true
-