class Decimator {

	public final void decimate(Geometry geom) {
		if (spanx == -1)
			return;
		if (geom instanceof MultiPoint) {
			// TODO check geometry and if its bbox is too small turn it into a 1
			// point geom
			return;
		}
		if (geom instanceof GeometryCollection) {
			// TODO check geometry and if its bbox is too small turn it into a
			// 1-2 point geom
			// takes a bit of work because the geometry will need to be
			// recreated.
			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));
			}
		}
	}

	public  Decimator(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance);
	public  Decimator(MathTransform screenToWorld, Rectangle paintArea);
	public  Decimator(MathTransform screenToWorld);
	public  Decimator(double spanx, double spany);

}