public class GeometryFixer extends Object
Geometry.isValid().
Input geometries are always processed, so even valid inputs may have some minor alterations. The output is always a new geometry object.
Coordinate.isValid().Point: keep valid coordinate, or EMPTYLineString: fix coordinate listLinearRing: fix coordinate list, return as valid ring or else LineStringPolygon: transform into a valid polygon,
preserving as much of the extent and vertices as possibleMultiPolygon: fix each polygon,
then ensure result is non-overlapping (via union)GeometryCollection: fix each elementkeepCollapsed setting:
false: (default) collapses are converted to empty geometriestrue: collapses are converted to a valid geometry of lower dimensionGeometry.isValid()| Constructor and Description |
|---|
GeometryFixer(Geometry geom)
Creates a new instance to fix a given geometry.
|
| Modifier and Type | Method and Description |
|---|---|
static Geometry |
fix(Geometry geom)
Fixes a geometry to be valid.
|
Geometry |
getResult()
Gets the fixed geometry.
|
void |
setKeepCollapsed(boolean isKeepCollapsed)
Sets whether collapsed geometries are converted to empty,
(which will be removed from collections),
or to a valid geometry of lower dimension.
|
public GeometryFixer(Geometry geom)
geom - the geometry to be fixedpublic static Geometry fix(Geometry geom)
geom - the geometry to be fixedpublic void setKeepCollapsed(boolean isKeepCollapsed)
isKeepCollapsed - whether collapses should be converted to a lower dimension geometrypublic Geometry getResult()
Copyright © 2021. All rights reserved.