GEOS 3.11.1
|
Snaps the vertices and segments of a geom::Geometry
to another Geometry's vertices.
More...
#include <GeometrySnapper.h>
Public Types | |
typedef std::unique_ptr< geom::Geometry > | GeomPtr |
Public Member Functions | |
GeometrySnapper (const geom::Geometry &g) | |
std::unique_ptr< geom::Geometry > | snapTo (const geom::Geometry &g, double snapTolerance) |
Snaps the vertices in the component geom::LineString s of the source geometry to the vertices of the given snap geometry with a given snap tolerance. More... | |
std::unique_ptr< geom::Geometry > | snapToSelf (double snapTolerance, bool cleanResult) |
Snaps the vertices in the component geom::LineString s of the source geometry to the vertices of itself with a given snap tolerance and optionally cleaning the result. More... | |
Static Public Member Functions | |
static void | snap (const geom::Geometry &g0, const geom::Geometry &g1, double snapTolerance, geom::GeomPtrPair &ret) |
static GeomPtr | snapToSelf (const geom::Geometry &g0, double snapTolerance, bool cleanResult) |
static double | computeOverlaySnapTolerance (const geom::Geometry &g) |
Estimates the snap tolerance for a Geometry, taking into account its precision model. More... | |
static double | computeSizeBasedSnapTolerance (const geom::Geometry &g) |
static double | computeOverlaySnapTolerance (const geom::Geometry &g1, const geom::Geometry &g2) |
Computes the snap tolerance based on input geometries;. | |
Snaps the vertices and segments of a geom::Geometry
to another Geometry's vertices.
A snap distance tolerance is used to control where snapping is performed. Snapping one geometry to another can improve robustness for overlay operations by eliminating nearly-coincident edges (which cause problems during noding and intersection calculation). Too much snapping can result in invalid topology being created, so the number and location of snapped vertices is decided using heuristics to determine when it is safe to snap. This can result in some potential snaps being omitted, however.
|
inline |
Creates a new snapper acting on the given geometry
g | the geometry to snap |
|
static |
Estimates the snap tolerance for a Geometry, taking into account its precision model.
g | a Geometry |
|
static |
Snaps two geometries together with a given tolerance.
g0 | a geometry to snap |
g1 | a geometry to snap |
snapTolerance | the tolerance to use |
ret | the snapped geometries as a pair of smart pointers (output parameter) |
std::unique_ptr< geom::Geometry > geos::operation::overlay::snap::GeometrySnapper::snapTo | ( | const geom::Geometry & | g, |
double | snapTolerance | ||
) |
Snaps the vertices in the component geom::LineString
s of the source geometry to the vertices of the given snap geometry with a given snap tolerance.
g | a geometry to snap the source to |
snapTolerance |
std::unique_ptr< geom::Geometry > geos::operation::overlay::snap::GeometrySnapper::snapToSelf | ( | double | snapTolerance, |
bool | cleanResult | ||
) |
Snaps the vertices in the component geom::LineString
s of the source geometry to the vertices of itself with a given snap tolerance and optionally cleaning the result.
snapTolerance | |
cleanResult | clean the result |