@Test public void testNoDecimation() { LinearRing g = gf.createLinearRing(csf.create(new double[] {0,0,0,10,2,10,2,0,0,0})); LinearRing original = (LinearRing) g.clone(); assertTrue(g.isValid()); Decimator d = new Decimator(-1, -1); d.decimate(g); g.geometryChanged(); assertTrue(g.isValid()); assertTrue(original.equalsExact(g)); }
public final void decimate(Geometry geom) { if (spanx == -1) return; if (geom instanceof MultiPoint) { return; } if (geom instanceof GeometryCollection) { GeometryCollection collection = (GeometryCollection) geom; final int numGeometries = collection.getNumGeometries(); for (int i = 0; i < numGeometries; i++) { decimate(collection.getGeometryN(i)); } } else if (geom instanceof LineString) { LineString line = (LineString) geom; LiteCoordinateSequence seq = (LiteCoordinateSequence) line .getCoordinateSequence(); if (decimateOnEnvelope(line, seq)) { return; } decimate(line, seq); } else if (geom instanceof Polygon) { Polygon line = (Polygon) geom; decimate(line.getExteriorRing()); final int numRings = line.getNumInteriorRing(); for (int i = 0; i < numRings; i++) { decimate(line.getInteriorRingN(i)); } } }
Decimator { public final void decimate(Geometry geom) { if (spanx == -1) return; if (geom instanceof MultiPoint) { return; } if (geom instanceof GeometryCollection) { GeometryCollection collection = (GeometryCollection) geom; final int numGeometries = collection.getNumGeometries(); for (int i = 0; i < numGeometries; i++) { decimate(collection.getGeometryN(i)); } } else if (geom instanceof LineString) { LineString line = (LineString) geom; LiteCoordinateSequence seq = (LiteCoordinateSequence) line .getCoordinateSequence(); if (decimateOnEnvelope(line, seq)) { return; } decimate(line, seq); } else if (geom instanceof Polygon) { Polygon line = (Polygon) geom; decimate(line.getExteriorRing()); final int numRings = line.getNumInteriorRing(); for (int i = 0; i < numRings; i++) { decimate(line.getInteriorRingN(i)); } } } }
Decimator { public final void decimate(Geometry geom) { if (spanx == -1) return; if (geom instanceof MultiPoint) { return; } if (geom instanceof GeometryCollection) { GeometryCollection collection = (GeometryCollection) geom; final int numGeometries = collection.getNumGeometries(); for (int i = 0; i < numGeometries; i++) { decimate(collection.getGeometryN(i)); } } else if (geom instanceof LineString) { LineString line = (LineString) geom; LiteCoordinateSequence seq = (LiteCoordinateSequence) line .getCoordinateSequence(); if (decimateOnEnvelope(line, seq)) { return; } decimate(line, seq); } else if (geom instanceof Polygon) { Polygon line = (Polygon) geom; decimate(line.getExteriorRing()); final int numRings = line.getNumInteriorRing(); for (int i = 0; i < numRings; i++) { decimate(line.getInteriorRingN(i)); } } } Decimator(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance);  Decimator(MathTransform screenToWorld, Rectangle paintArea);  Decimator(MathTransform screenToWorld);  Decimator(double spanx, double spany); }
Decimator { public final void decimate(Geometry geom) { if (spanx == -1) return; if (geom instanceof MultiPoint) { return; } if (geom instanceof GeometryCollection) { GeometryCollection collection = (GeometryCollection) geom; final int numGeometries = collection.getNumGeometries(); for (int i = 0; i < numGeometries; i++) { decimate(collection.getGeometryN(i)); } } else if (geom instanceof LineString) { LineString line = (LineString) geom; LiteCoordinateSequence seq = (LiteCoordinateSequence) line .getCoordinateSequence(); if (decimateOnEnvelope(line, seq)) { return; } decimate(line, seq); } else if (geom instanceof Polygon) { Polygon line = (Polygon) geom; decimate(line.getExteriorRing()); final int numRings = line.getNumInteriorRing(); for (int i = 0; i < numRings; i++) { decimate(line.getInteriorRingN(i)); } } } Decimator(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance);  Decimator(MathTransform screenToWorld, Rectangle paintArea);  Decimator(MathTransform screenToWorld);  Decimator(double spanx, double spany); static double[] computeGeneralizationDistances(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance); final void decimateTransformGeneralize(Geometry geometry,
			MathTransform transform); final void decimate(Geometry geom); }
Decimator { public final void decimate(Geometry geom) { if (spanx == -1) return; if (geom instanceof MultiPoint) { return; } if (geom instanceof GeometryCollection) { GeometryCollection collection = (GeometryCollection) geom; final int numGeometries = collection.getNumGeometries(); for (int i = 0; i < numGeometries; i++) { decimate(collection.getGeometryN(i)); } } else if (geom instanceof LineString) { LineString line = (LineString) geom; LiteCoordinateSequence seq = (LiteCoordinateSequence) line .getCoordinateSequence(); if (decimateOnEnvelope(line, seq)) { return; } decimate(line, seq); } else if (geom instanceof Polygon) { Polygon line = (Polygon) geom; decimate(line.getExteriorRing()); final int numRings = line.getNumInteriorRing(); for (int i = 0; i < numRings; i++) { decimate(line.getInteriorRingN(i)); } } } Decimator(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance);  Decimator(MathTransform screenToWorld, Rectangle paintArea);  Decimator(MathTransform screenToWorld);  Decimator(double spanx, double spany); static double[] computeGeneralizationDistances(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance); final void decimateTransformGeneralize(Geometry geometry,
			MathTransform transform); final void decimate(Geometry geom);  }