GEOS 3.14.0dev
|
#include <OverlayUtil.h>
Static Public Member Functions | |
static bool | isFloating (const PrecisionModel *pm) |
static bool | clippingEnvelope (int opCode, const InputGeometry *inputGeom, const PrecisionModel *pm, Envelope &rsltEnvelope) |
static bool | isEmptyResult (int opCode, const Geometry *a, const Geometry *b, const PrecisionModel *pm) |
static bool | isEnvDisjoint (const Geometry *a, const Geometry *b, const PrecisionModel *pm) |
static std::unique_ptr< Geometry > | createEmptyResult (int dim, const GeometryFactory *geomFact) |
static int | resultDimension (int opCode, int dim0, int dim1) |
static std::unique_ptr< Geometry > | createResultGeometry (std::vector< std::unique_ptr< Polygon > > &resultPolyList, std::vector< std::unique_ptr< LineString > > &resultLineList, std::vector< std::unique_ptr< Point > > &resultPointList, const GeometryFactory *geometryFactory) |
static std::unique_ptr< Geometry > | toLines (OverlayGraph *graph, bool isOutputEdges, const GeometryFactory *geomFact) |
static bool | isResultAreaConsistent (const Geometry *geom0, const Geometry *geom1, int opCode, const Geometry *result) |
static bool | round (const Point *pt, const PrecisionModel *pm, Coordinate &rsltCoord) |
template<typename T > | |
static void | moveGeometry (std::vector< std::unique_ptr< T > > &inGeoms, std::vector< std::unique_ptr< Geometry > > &outGeoms) |
Utility methods for overlay processing.
|
static |
Computes a clipping envelope for overlay input geometries. The clipping envelope encloses all geometry line segments which might participate in the overlay, with a buffer to account for numerical precision (in particular, rounding due to a precision model. The clipping envelope is used in both the RingClipper
and in the LineLimiter
.
Some overlay operations (i.e. UNION and SYMDIFFERENCE cannot use clipping as an optimization, since the result envelope is the full extent of the two input geometries. In this case the returned envelope is null to indicate this.
|
static |
Creates an empty result geometry of the appropriate dimension, based on the given overlay operation and the dimensions of the inputs. The created geometry is an atomic geometry, not a collection (unless the dimension is -1, in which case a GEOMETRYCOLLECTION EMPTY is created.)
|
static |
Creates an overlay result geometry for homogeneous or mixed components.
|
static |
Tests if the result can be determined to be empty based on simple properties of the input geometries (such as whether one or both are empty, or their envelopes are disjoint).
|
static |
Tests if the geometry envelopes are disjoint, or empty. The disjoint test must take into account the precision model being used, since geometry coordinates may shift under rounding.
|
static |
A heuristic check for overlay result correctness comparing the areas of the input and result. The heuristic is necessarily coarse, but it detects some obvious issues. (e.g. https://github.com/locationtech/jts/issues/798)
Note: - this check is only safe if the precision model is floating. It should also be safe for snapping noding if the distance tolerance is reasonably small. (Fixed precision models can lead to collapse causing result area to expand.)
geom0 | input geometry 0 |
geom1 | input geometry 1 |
opCode | the overlay opcode |
result | the overlay result |
|
static |
Computes the dimension of the result of applying the given operation to inputs with the given dimensions. This assumes that complete collapse does not occur.
The result dimension is computed according to the following rules:
|
static |
Round the key point if precision model is fixed. Note: return value is only copied if rounding is performed.