Package org.locationtech.jts.precision
Class CoordinatePrecisionReducerFilter
- java.lang.Object
-
- org.locationtech.jts.precision.CoordinatePrecisionReducerFilter
-
- All Implemented Interfaces:
CoordinateSequenceFilter
public class CoordinatePrecisionReducerFilter extends java.lang.Object implements CoordinateSequenceFilter
Reduces the precision of theCoordinate
s in aCoordinateSequence
to match the suppliedPrecisionModel
. UsesPrecisionModel.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
Constructors Constructor Description CoordinatePrecisionReducerFilter(PrecisionModel precModel)
Creates a new precision reducer filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
filter(CoordinateSequence seq, int i)
Rounds the Coordinates in the sequence to match the PrecisionModelboolean
isDone()
Always runs over all geometry components.boolean
isGeometryChanged()
Always reports that the geometry has changed
-
-
-
Constructor Detail
-
CoordinatePrecisionReducerFilter
public CoordinatePrecisionReducerFilter(PrecisionModel precModel)
Creates a new precision reducer filter.- Parameters:
precModel
- the PrecisionModel to use
-
-
Method Detail
-
filter
public void filter(CoordinateSequence seq, int i)
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
-
-