public class CoverageSimplifier extends Object
The amount of simplification is determined by a tolerance value, which is a non-negative quantity. It equates roughly to the maximum distance by which a simplified line can change from the original. (In fact, it is the square root of the area tolerance used in the Visvalingam-Whyatt algorithm.)
The simplified result coverage has the following characteristics:
The class allows specifying a separate tolerance for each element of the input coverage.
The input coverage should be valid according to CoverageValidator.
Invalid coverages may be simplified, but the result will likely still be invalid.
| Constructor and Description |
|---|
CoverageSimplifier(Geometry[] coverage)
Create a new coverage simplifier instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setRemovableRingSizeFactor(double removableSizeFactor)
Sets the factor applied to the area tolerance to determine
if small rings should be removed.
|
void |
setSmoothWeight(double smoothWeight)
Sets the weight influencing how smooth the simplification should be.
|
Geometry[] |
simplify(double tolerance)
Computes the simplified coverage using a single distance tolerance,
preserving the coverage topology.
|
Geometry[] |
simplify(double[] tolerances)
Computes the simplified coverage using separate distance tolerances
for each coverage element,
preserving the coverage topology.
|
Geometry[] |
simplify(double toleranceInner,
double toleranceOuter)
Computes the simplified coverage using separate distance tolerances
for inner and outer edges,
preserving the coverage topology.
|
static Geometry[] |
simplify(Geometry[] coverage,
double tolerance)
Simplifies the boundaries of a set of polygonal geometries forming a coverage,
preserving the coverage topology.
|
static Geometry[] |
simplify(Geometry[] coverage,
double[] tolerances)
Simplifies the boundaries of a set of polygonal geometries forming a coverage,
preserving the coverage topology, using a separate tolerance
for each element of the coverage.
|
static Geometry[] |
simplifyInner(Geometry[] coverage,
double tolerance)
Simplifies the inner boundaries of a set of polygonal geometries forming a coverage,
preserving the coverage topology.
|
static Geometry[] |
simplifyOuter(Geometry[] coverage,
double tolerance)
Simplifies the outer boundaries of a set of polygonal geometries forming a coverage,
preserving the coverage topology.
|
public CoverageSimplifier(Geometry[] coverage)
coverage - a set of polygonal geometries forming a coveragepublic static Geometry[] simplify(Geometry[] coverage, double tolerance)
coverage - a set of polygonal geometries forming a coveragetolerance - the simplification tolerancepublic static Geometry[] simplify(Geometry[] coverage, double[] tolerances)
coverage - a set of polygonal geometries forming a coveragetolerance - the simplification tolerances (one per input element)public static Geometry[] simplifyInner(Geometry[] coverage, double tolerance)
coverage - a set of polygonal geometries forming a coveragetolerance - the simplification tolerancepublic static Geometry[] simplifyOuter(Geometry[] coverage, double tolerance)
coverage - a set of polygonal geometries forming a coveragetolerance - the simplification tolerancepublic void setRemovableRingSizeFactor(double removableSizeFactor)
removableSizeFactor - the factor to determine ring size to removepublic void setSmoothWeight(double smoothWeight)
smoothWeight - a value between 0 and 1public Geometry[] simplify(double tolerance)
tolerance - the simplification distance tolerancepublic Geometry[] simplify(double toleranceInner, double toleranceOuter)
toleranceInner - the distance tolerance for inner edgestoleranceOuter - the distance tolerance for outer edgespublic Geometry[] simplify(double[] tolerances)
tolerances - the distance tolerances for the coverage elementsCopyright © 2024. All rights reserved.