GEOS 3.11.1
|
#include <OverlayNG.h>
Public Member Functions | |
OverlayNG (const geom::Geometry *geom0, const geom::Geometry *geom1, const geom::GeometryFactory *p_geomFact, int p_opCode) | |
OverlayNG (const geom::Geometry *geom0, const geom::Geometry *geom1, const geom::PrecisionModel *p_pm, int p_opCode) | |
OverlayNG (const geom::Geometry *geom0, const geom::Geometry *geom1, int p_opCode) | |
OverlayNG (const geom::Geometry *geom0, const geom::PrecisionModel *p_pm) | |
void | setOptimized (bool p_isOptimized) |
void | setStrictMode (bool p_isStrictMode) |
void | setAreaResultOnly (bool p_areaResultOnly) |
void | setOutputEdges (bool p_isOutputEdges) |
void | setOutputResultEdges (bool p_isOutputResultEdges) |
void | setNoder (noding::Noder *p_noder) |
void | setOutputNodedEdges (bool p_isOutputNodedEdges) |
std::unique_ptr< Geometry > | getResult () |
Static Public Member Functions | |
static bool | isResultOfOpPoint (const OverlayLabel *label, int opCode) |
static bool | isResultOfOp (int overlayOpCode, Location loc0, Location loc1) |
static std::unique_ptr< Geometry > | overlay (const Geometry *geom0, const Geometry *geom1, int opCode, const PrecisionModel *pm) |
static std::unique_ptr< Geometry > | overlay (const Geometry *geom0, const Geometry *geom1, int opCode, const PrecisionModel *pm, noding::Noder *noder) |
static std::unique_ptr< Geometry > | overlay (const Geometry *geom0, const Geometry *geom1, int opCode, noding::Noder *noder) |
static std::unique_ptr< Geometry > | overlay (const Geometry *geom0, const Geometry *geom1, int opCode) |
static std::unique_ptr< Geometry > | geomunion (const Geometry *geom, const PrecisionModel *pm) |
static std::unique_ptr< Geometry > | geomunion (const Geometry *geom, const PrecisionModel *pm, noding::Noder *noder) |
Static Public Attributes | |
static constexpr bool | STRICT_MODE_DEFAULT = false |
static constexpr int | INTERSECTION = overlay::OverlayOp::opINTERSECTION |
static constexpr int | UNION = overlay::OverlayOp::opUNION |
static constexpr int | DIFFERENCE = overlay::OverlayOp::opDIFFERENCE |
static constexpr int | SYMDIFFERENCE = overlay::OverlayOp::opSYMDIFFERENCE |
Computes the geometric overlay of two geom::Geometry
s, using an explicit precision model to allow robust computation. The overlay can be used to determine any of the following set-theoretic operations (boolean combinations) of the geometries:
The requirements for overlay input are:
The precision model used for the computation can be supplied independent of the precision model of the input geometry. The main use for this is to allow using a fixed precision for geometry with a floating precision model. This does two things: ensures robust computation; and forces the output to be validly rounded to the precision model.
For fixed precision models noding is performed using a noding::snapround::SnapRoundingNoder
. This provides robust computation (as long as precision is limited to around 13 decimal digits).
For floating precision an noding::MCIndexNoder
is used. This is not fully robust, so can sometimes result in util::TopologyException
s being thrown. For robust full-precision overlay see OverlayNGRobust
.
Note: If a noding::snap::SnappingNoder
is used it is best to specify a fairly small snap tolerance, since the intersection clipping optimization can interact with the snapping to alter the result.
Optionally the overlay computation can process using strict mode (via setStrictMode(boolean). In strict mode result semantics are:
Strict mode has the following benefits:
The original JTS overlay semantics correspond to non-strict mode.
If a robustness error occurs, a TopologyException is thrown. These are usually caused by numerical rounding causing the noding output to not be fully noded. For robust computation with full-precision OverlayNGRobust
can be used.
|
inline |
Creates an overlay operation on the given geometries, with a defined precision model. The noding strategy is determined by the precision model.
|
inline |
Creates an overlay operation on the given geometries, with a defined precision model. The noding strategy is determined by the precision model.
|
inline |
Creates an overlay operation on the given geometries using the precision model of the geometries.
The noder is chosen according to the precision model specified.
PrecisionModel#FIXED
a snap-rounding noder is used, and the computation is robust.PrecisionModel#FLOATING
a non-snapping noder is used, and this computation may not be robust. If errors occur a util::TopologyException
is thrown.
|
static |
Computes a union operation on the given geometry, with the supplied precision model. The primary use for this is to perform precision reduction (round the geometry to the supplied precision).
The input must be a valid geometry. Collections must be homogeneous. IMPORTANT: You probably want OverlayNGUnaryUnion, not this.
geom | the geometry |
pm | the precision model to use |
|
static |
Computes a union of a single geometry using a custom noder.
The primary use of this is to support coverage union.
The input must be a valid geometry. Collections must be homogeneous. IMPORTANT: You probably want OverlayNGUnaryUnion, not this.
geom | the geometry to union |
pm | the precision model to use (maybe be null) |
noder | the noder to use |
std::unique_ptr< Geometry > geos::operation::overlayng::OverlayNG::getResult | ( | ) |
Gets the result of the overlay operation.
IllegalArgumentException | if the input is not supported (e.g. a mixed-dimension geometry) |
TopologyException | if a robustness error occurs |
|
static |
Tests whether a point with given geom::Location
s relative to two geometries would be contained in the result of overlaying the geometries using a given overlay operation. This is used to determine whether components computed during the overlay process should be included in the result geometry.
The method handles arguments of Location#NONE
correctly.
|
static |
Tests whether a point with a given topological OverlayLabel
relative to two geometries is contained in the result of overlaying the geometries using a given overlay operation.
The method handles arguments of Location#NONE
correctly
|
static |
Computes an overlay operation on the given geometry operands, using the precision model of the geometry. and an appropriate noder.
The noder is chosen according to the precision model specified.
geom::PrecisionModel#FIXED
a snap-rounding noder is used, and the computation is robust.geom::PrecisionModel#FLOATING
a non-snapping noder is used, and this computation may not be robust. If errors occur a util::TopologyException
is thrown.geom0 | the first argument geometry |
geom1 | the second argument geometry |
opCode | the code for the desired overlay operation |
|
static |
Computes an overlay operation for the given geometry operands, with the noding strategy determined by the precision model.
geom0 | the first geometry argument |
geom1 | the second geometry argument |
opCode | the code for the desired overlay operation |
pm | the precision model to use |
Referenced by geos::operation::overlayng::UnaryUnionNG::NGUnionStrategy::Union().
|
static |
Computes an overlay operation on the given geometry operands, using a supplied noding::Noder
.
geom0 | the first geometry argument |
geom1 | the second geometry argument |
opCode | the code for the desired overlay operation |
pm | the precision model to use (which may be null if the noder does not use one) |
noder | the noder to use |
|
static |
Computes an overlay operation on the given geometry operands, using a supplied noding::Noder
.
geom0 | the first geometry argument |
geom1 | the second geometry argument |
opCode | the code for the desired overlay operation |
noder | the noder to use |
|
inline |
Sets whether overlay processing optimizations are enabled. It may be useful to disable optimizations for testing purposes. Default is TRUE (optimization enabled).
p_isOptimized | whether to optimize processing |
|
staticconstexpr |
The default setting for Strict Mode.
The original JTS overlay semantics used non-strict result semantics, including;