#include <GeometrySnapper.h>
Public Types | |
typedef std::auto_ptr< geom::Geometry > | GeomPtr |
typedef std::pair< GeomPtr, GeomPtr > | GeomPtrPair |
Public Member Functions | |
GeometrySnapper (const geom::Geometry &g) | |
std::auto_ptr< geom::Geometry > | snapTo (const geom::Geometry &g, double snapTolerance) |
Snaps the vertices in the component LineStrings of the source geometry to the vertices of the given snap geometry with a given snap tolerance. | |
std::auto_ptr< geom::Geometry > | snapToSelf (double snapTolerance, bool cleanResult) |
Snaps the vertices in the component LineStrings of the source geometry to the vertices of itself with a given snap tolerance and optionally cleaning the result. | |
Static Public Member Functions | |
void | snap (const geom::Geometry &g0, const geom::Geometry &g1, double snapTolerance, GeomPtrPair &ret) |
GeomPtr | snapToSelf (const geom::Geometry &g0, double snapTolerance, bool cleanResult) |
double | computeOverlaySnapTolerance (const geom::Geometry &g) |
Estimates the snap tolerance for a Geometry, taking into account its precision model. | |
double | computeSizeBasedSnapTolerance (const geom::Geometry &g) |
double | computeOverlaySnapTolerance (const geom::Geometry &g1, const geom::Geometry &g2) |
Computes the snap tolerance based on input geometries;. |
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.
|
Creates a new snapper acting on the given geometry
|
|
Estimates the snap tolerance for a Geometry, taking into account its precision model.
|
|
Snaps two geometries together with a given tolerance.
|
|
Snaps the vertices in the component LineStrings of the source geometry to the vertices of the given snap geometry with a given snap tolerance.
|
|
Snaps the vertices in the component LineStrings of the source geometry to the vertices of itself with a given snap tolerance and optionally cleaning the result.
|