public class GeometryClipper extends Object
Constructor and Description |
---|
GeometryClipper(Envelope bounds) |
Modifier and Type | Method and Description |
---|---|
Geometry |
clip(Geometry g,
boolean ensureValid)
Clips the geometry on the specified bounds.
|
Geometry |
clipSafe(Geometry g,
boolean ensureValid,
double scale)
This will try to handle failures when clipping - i.e. because of invalid input geometries
(often caused by simplification).
|
Envelope |
getBounds() |
public Envelope getBounds()
public Geometry clipSafe(Geometry g, boolean ensureValid, double scale)
This attempts to do a normal clip(). If it fails, it will try to do more to ensure the clip works properly.
clip
g
- ensureValid
- scale
- Scale used to snap geometry to precision model, 0 to disablepublic Geometry clip(Geometry g, boolean ensureValid)
g
- The geometry to be clippedensureValid
- If false there is no guarantee the polygons returned will be valid
according to JTS rules (but should still be good enough to be used for pure rendering)Copyright © 1996–2019 Geotools. All rights reserved.