GEOS 3.14.0dev
|
#include <GeometryFixer.h>
Public Member Functions | |
GeometryFixer (const geom::Geometry *p_geom) | |
void | setKeepCollapsed (bool p_isKeepCollapsed) |
std::unique_ptr< geom::Geometry > | getResult () const |
Static Public Member Functions | |
static std::unique_ptr< geom::Geometry > | fix (const geom::Geometry *geom) |
Fixes a geometry to be a valid geometry, while preserving as much as possible of the shape and location of the input. Validity is determined according to Geometry#isValid()
.
Input geometries are always processed, so even valid inputs may have some minor alterations. The output is always a new geometry object.
Point
: keep valid coordinate, or EMPTYLineString
: coordinates are fixedLinearRing
: coordinates are fixed, Keep valid ring or else convert into LineString
Polygon
: transform into a valid polygon,MultiPolygon
: each polygon is fixed, then result made non-overlapping (via union)GeometryCollection
: each element is fixedkeepCollapsed
setting:false
: (default) collapses are converted to empty geometriestrue
: collapses are converted to a valid geometry of lower dimensionstd::unique_ptr< geom::Geometry > geos::geom::util::GeometryFixer::getResult | ( | ) | const |
Gets the fixed geometry.
void geos::geom::util::GeometryFixer::setKeepCollapsed | ( | bool | p_isKeepCollapsed | ) |
Sets whether collapsed geometries are converted to empty, (which will be removed from collections), or to a valid geom::Geometry of lower dimension. The default is to convert collapses to empty geometries.
p_isKeepCollapsed | whether collapses should be converted to a lower dimension geometry |