Class CoordinatePrecisionReducerFilter
java.lang.Object
org.locationtech.jts.precision.CoordinatePrecisionReducerFilter
- All Implemented Interfaces:
CoordinateSequenceFilter
Reduces the precision of the
Coordinates 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.- Author:
- mbdavis
-
Constructor Summary
ConstructorsConstructorDescriptionCoordinatePrecisionReducerFilter(PrecisionModel precModel) Creates a new precision reducer filter. -
Method Summary
Modifier and TypeMethodDescriptionvoidfilter(CoordinateSequence seq, int i) Rounds the Coordinates in the sequence to match the PrecisionModelbooleanisDone()Always runs over all geometry components.booleanAlways reports that the geometry has changed
-
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:
filterin interfaceCoordinateSequenceFilter- Parameters:
seq- theCoordinateSequenceto 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:
isDonein interfaceCoordinateSequenceFilter- Returns:
- false
-
isGeometryChanged
public boolean isGeometryChanged()Always reports that the geometry has changed- Specified by:
isGeometryChangedin interfaceCoordinateSequenceFilter- Returns:
- true
-