public class PolygonHullSimplifier extends Object
Polygons with holes and MultiPolygons are supported. The result has the same geometric type and structure as the input.
The number of vertices in the computed hull is determined by a target parameter. Two parameters are supported:
Constructor and Description |
---|
PolygonHullSimplifier(Geometry inputGeom,
boolean isOuter)
Creates a new instance
to compute a simplified hull of a polygonal geometry.
|
Modifier and Type | Method and Description |
---|---|
Geometry |
getResult()
Gets the result polygonal hull geometry.
|
static Geometry |
hull(Geometry geom,
boolean isOuter,
double vertexNumFraction)
Computes a topology-preserving simplified hull of a polygonal geometry,
with hull shape determined by a target parameter
specifying the fraction of the input vertices retained in the result.
|
static Geometry |
hullByAreaDelta(Geometry geom,
boolean isOuter,
double areaDeltaRatio)
Computes a topology-preserving simplified hull of a polygonal geometry,
with hull shape determined by a target parameter
specifying the ratio of maximum difference in area to original area.
|
void |
setAreaDeltaRatio(double areaDeltaRatio)
Sets the target maximum ratio of the change in area of the result to the input area.
|
void |
setVertexNumFraction(double vertexNumFraction)
Sets the target fraction of input vertices
which are retained in the result.
|
public PolygonHullSimplifier(Geometry inputGeom, boolean isOuter)
isOuter
.inputGeom
- the polygonal geometry to processisOuter
- indicates whether to compute an outer or inner hullpublic static Geometry hull(Geometry geom, boolean isOuter, double vertexNumFraction)
geom
- the polygonal geometry to processisOuter
- indicates whether to compute an outer or inner hullvertexNumFraction
- the target fraction of number of input vertices in resultpublic static Geometry hullByAreaDelta(Geometry geom, boolean isOuter, double areaDeltaRatio)
geom
- the polygonal geometry to processisOuter
- indicates whether to compute an outer or inner hullareaDeltaRatio
- the target ratio of area difference to original areapublic void setVertexNumFraction(double vertexNumFraction)
vertexNumFraction
- a fraction of the number of input verticespublic void setAreaDeltaRatio(double areaDeltaRatio)
areaDeltaRatio
- a ratio of the change in area of the resultpublic Geometry getResult()
Copyright © 2022. All rights reserved.