JTS Topology Suite - v 1.12

com.vividsolutions.jts.precision
Class CoordinatePrecisionReducerFilter

java.lang.Object
  extended by com.vividsolutions.jts.precision.CoordinatePrecisionReducerFilter
All Implemented Interfaces:
CoordinateSequenceFilter

public class CoordinatePrecisionReducerFilter
extends java.lang.Object
implements 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
CoordinatePrecisionReducerFilter(PrecisionModel precModel)
          Creates a new precision reducer filter.
 
Method Summary
 void filter(CoordinateSequence seq, int i)
          Rounds the Coordinates in the sequence to match the PrecisionModel
 boolean isDone()
          Always runs over all geometry components.
 boolean isGeometryChanged()
          Always reports that the geometry has changed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface CoordinateSequenceFilter
Parameters:
seq - the CoordinateSequence to which the filter is applied
i - the index of the coordinate to apply the filter to

isDone

public boolean isDone()
Always runs over all geometry components.

Specified by:
isDone in interface CoordinateSequenceFilter
Returns:
false

isGeometryChanged

public boolean isGeometryChanged()
Always reports that the geometry has changed

Specified by:
isGeometryChanged in interface CoordinateSequenceFilter
Returns:
true

JTS Topology Suite - v 1.12