public final class Decimator extends Object
LiteCoordinateSequence
instances.Constructor and Description |
---|
Decimator(double spanx,
double spany) |
Decimator(MathTransform screenToWorld)
Deprecated.
use the other constructor (with rectange) see javadox. This works fine, but it
the results are often poor if you're also doing CRS xforms.
|
Decimator(MathTransform screenToWorld,
Rectangle paintArea)
djb - noticed that the old way of finding out the decimation is based on the (0,0) location
of the image.
|
Decimator(MathTransform screenToWorld,
Rectangle paintArea,
double pixelDistance)
Builds a decimator that will generalize geometries so that two subsequent points will be at
least pixelDistance away from each other when painted on the screen.
|
Modifier and Type | Method and Description |
---|---|
static double[] |
computeGeneralizationDistances(MathTransform screenToWorld,
Rectangle paintArea,
double pixelDistance)
Given a full transformation from screen to world and the paint area computes a best guess of
the maxium generalization distance that won't make the transformations induced by the
generalization visible on screen.
|
void |
decimate(Geometry geom)
decimates JTS geometries.
|
Geometry |
decimateTransformGeneralize(Geometry geometry,
MathTransform transform) |
double |
getSpanX()
The generalization step in the x direction
|
double |
getSpanY()
The generalization step in the y direction
|
public Decimator(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance)
screenToWorld
- paintArea
- pixelDistance
- public Decimator(MathTransform screenToWorld, Rectangle paintArea)
A better thing to do is to decimate this on a per-shape basis (and use the shape's center). Another option would be to sample the image at different locations (say 9) and choose the smallest spanx/spany you find.
Also, if the xform is an affine Xform, you can be a bit more aggressive in the decimation. If its not an affine xform (ie. its actually doing a CRS xform), you may find this is a bit too aggressive due to any number of mathematical issues.
This is just a simple method that uses the centre of the given rectangle instead of (0,0).
NOTE: this could need more work based on CRS, but the rectangle is in pixels so it should be fairly immune to all but crazy projections.
screenToWorld
- paintArea
- public Decimator(MathTransform screenToWorld)
TransformException
public Decimator(double spanx, double spany)
public double getSpanX()
public double getSpanY()
public static double[] computeGeneralizationDistances(MathTransform screenToWorld, Rectangle paintArea, double pixelDistance) throws TransformException
In other words, it computes how long a pixel is in the native spatial reference system of the data
screenToWorld
- paintArea
- TransformException
public final Geometry decimateTransformGeneralize(Geometry geometry, MathTransform transform) throws TransformException
TransformException
public final void decimate(Geometry geom)
Copyright © 1996–2019 Geotools. All rights reserved.