/** * Creates a new instance of LineIterator * * @param ls The line string the iterator will use * @param at The affine transform applied to coordinates during iteration */ public PackedLineIterator(LineString ls, AffineTransform at, boolean generalize, float maxDistance) { if (at == null) { at = new AffineTransform(); } this.at = at; xScale = (float) Math.sqrt( (at.getScaleX() * at.getScaleX()) + (at.getShearX() * at.getShearX())); yScale = (float) Math.sqrt( (at.getScaleY() * at.getScaleY()) + (at.getShearY() * at.getShearY())); coordinates = (Double) ls.getCoordinateSequence(); coordinateCount = coordinates.size(); isClosed = ls instanceof LinearRing; this.generalize = generalize; this.maxDistance = maxDistance; }
/** * Creates a new instance of LineIterator * * @param ls The line string the iterator will use * @param at The affine transform applied to coordinates during iteration */ public PackedLineIterator(LineString ls, AffineTransform at, boolean generalize, float maxDistance) { if (at == null) { at = new AffineTransform(); } this.at = at; xScale = (float) Math.sqrt( (at.getScaleX() * at.getScaleX()) + (at.getShearX() * at.getShearX())); yScale = (float) Math.sqrt( (at.getScaleY() * at.getScaleY()) + (at.getShearY() * at.getShearY())); coordinates = (Double) ls.getCoordinateSequence(); coordinateCount = coordinates.size(); isClosed = ls instanceof LinearRing; this.generalize = generalize; this.maxDistance = maxDistance; }