GEOS
3.9.1dev
|
#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 |
Private Member Functions | |
std::unique_ptr< geom::Geometry > | computeEdgeOverlay () |
void | labelGraph (OverlayGraph *graph) |
std::unique_ptr< geom::Geometry > | extractResult (int opCode, OverlayGraph *graph) |
std::unique_ptr< geom::Geometry > | createEmptyResult () |
Private Attributes | |
const geom::PrecisionModel * | pm |
InputGeometry | inputGeom |
const geom::GeometryFactory * | geomFact |
int | opCode |
noding::Noder * | noder |
bool | isStrictMode |
bool | isOptimized |
bool | isAreaResultOnly |
bool | isOutputEdges |
bool | isOutputResultEdges |
bool | isOutputNodedEdges |
Computes the geometric overlay of two geom::Geometrys, 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:
Input geometries may have different dimension. Input collections must be homogeneous (all elements must have the same dimension).
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::TopologyExceptions 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.
TOptionally 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.
Definition at line 115 of file OverlayNG.h.
|
inline |
Creates an overlay operation on the given geometries, with a defined precision model. The noding strategy is determined by the precision model.
Definition at line 177 of file OverlayNG.h.
|
inline |
Creates an overlay operation on the given geometries, with a defined precision model. The noding strategy is determined by the precision model.
Definition at line 196 of file OverlayNG.h.
|
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.
Definition at line 223 of file OverlayNG.h.
|
inline |
Definition at line 227 of file OverlayNG.h.
|
private |
|
private |
|
private |
Extracts the result geometry components from the fully labelled topology graph.
This method implements the semantic that the result of an intersection operation is homogeneous with highest dimension. In other words, if an intersection has components of a given dimension no lower-dimension components are output. For example, if two polygons intersect in an area, no linestrings or points are included in the result, even if portions of the input do meet in lines or points. This semantic choice makes more sense for typical usage, in which only the highest dimension components are of interest.
|
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::Locations 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
|
private |
|
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 |
|
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 |
|
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.
geom0 | the first argument geometry |
geom1 | the second argument geometry |
opCode | the code for the desired overlay operation |
|
inline |
Definition at line 241 of file OverlayNG.h.
|
inline |
Definition at line 244 of file OverlayNG.h.
|
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 |
Definition at line 239 of file OverlayNG.h.
|
inline |
Definition at line 242 of file OverlayNG.h.
|
inline |
Definition at line 246 of file OverlayNG.h.
|
inline |
Definition at line 243 of file OverlayNG.h.
|
inline |
Definition at line 240 of file OverlayNG.h.
|
static |
Definition at line 169 of file OverlayNG.h.
|
private |
Definition at line 122 of file OverlayNG.h.
|
private |
Definition at line 121 of file OverlayNG.h.
|
static |
Definition at line 167 of file OverlayNG.h.
|
private |
Definition at line 127 of file OverlayNG.h.
|
private |
Definition at line 126 of file OverlayNG.h.
|
private |
Definition at line 128 of file OverlayNG.h.
|
private |
Definition at line 130 of file OverlayNG.h.
|
private |
Definition at line 129 of file OverlayNG.h.
|
private |
Definition at line 125 of file OverlayNG.h.
|
private |
Definition at line 124 of file OverlayNG.h.
|
private |
Definition at line 123 of file OverlayNG.h.
|
private |
Definition at line 120 of file OverlayNG.h.
|
static |
The default setting for Strict Mode.
The original JTS overlay semantics used non-strict result semantics, including;
Definition at line 165 of file OverlayNG.h.
|
static |
Definition at line 170 of file OverlayNG.h.
|
static |
Definition at line 168 of file OverlayNG.h.