GEOS  3.9.1dev
Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
geos::operation::overlayng::OverlayUtil Class Reference

#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< GeometrycreateEmptyResult (int dim, const GeometryFactory *geomFact)
 
static int resultDimension (int opCode, int dim0, int dim1)
 
static std::unique_ptr< GeometrycreateResultGeometry (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< GeometrytoLines (OverlayGraph *graph, bool isOutputEdges, const GeometryFactory *geomFact)
 
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)
 

Static Private Member Functions

static bool resultEnvelope (int opCode, const InputGeometry *inputGeom, const PrecisionModel *pm, Envelope &rsltEnvelope)
 
static double safeExpandDistance (const Envelope *env, const PrecisionModel *pm)
 
static bool safeEnv (const Envelope *env, const PrecisionModel *pm, Envelope &rsltEnvelope)
 
static bool isEmpty (const Geometry *geom)
 
static bool isDisjoint (const Envelope *envA, const Envelope *envB, const PrecisionModel *pm)
 

Static Private Attributes

static constexpr double SAFE_ENV_BUFFER_FACTOR = 0.1
 
static constexpr int SAFE_ENV_GRID_FACTOR = 3
 

Detailed Description

Utility methods for overlay processing.

Author
mdavis

Definition at line 57 of file OverlayUtil.h.

Member Function Documentation

static bool geos::operation::overlayng::OverlayUtil::clippingEnvelope ( int  opCode,
const InputGeometry inputGeom,
const PrecisionModel pm,
Envelope rsltEnvelope 
)
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 std::unique_ptr<Geometry> geos::operation::overlayng::OverlayUtil::createEmptyResult ( int  dim,
const GeometryFactory geomFact 
)
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 std::unique_ptr<Geometry> geos::operation::overlayng::OverlayUtil::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

Creates an overlay result geometry for homogeneous or mixed components.

static bool geos::operation::overlayng::OverlayUtil::isDisjoint ( const Envelope envA,
const Envelope envB,
const PrecisionModel pm 
)
staticprivate

Tests for disjoint envelopes adjusting for rounding caused by a fixed precision model. Assumes envelopes are non-empty.

static bool geos::operation::overlayng::OverlayUtil::isEmpty ( const Geometry geom)
staticprivate
static bool geos::operation::overlayng::OverlayUtil::isEmptyResult ( int  opCode,
const Geometry a,
const Geometry b,
const PrecisionModel pm 
)
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 bool geos::operation::overlayng::OverlayUtil::isEnvDisjoint ( const Geometry a,
const Geometry b,
const PrecisionModel pm 
)
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 bool geos::operation::overlayng::OverlayUtil::isFloating ( const PrecisionModel pm)
static
template<typename T >
static void geos::operation::overlayng::OverlayUtil::moveGeometry ( std::vector< std::unique_ptr< T >> &  inGeoms,
std::vector< std::unique_ptr< Geometry >> &  outGeoms 
)
inlinestatic

Definition at line 168 of file OverlayUtil.h.

static int geos::operation::overlayng::OverlayUtil::resultDimension ( int  opCode,
int  dim0,
int  dim1 
)
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 bool geos::operation::overlayng::OverlayUtil::resultEnvelope ( int  opCode,
const InputGeometry inputGeom,
const PrecisionModel pm,
Envelope rsltEnvelope 
)
staticprivate

Computes an envelope which covers the extent of the result of a given overlay operation for given inputs. The operations which have a result envelope smaller than the extent of the inputs are:

  • INTERSECTION: result envelope is the intersection of the input envelopes
  • DIFERENCE: result envelope is the envelope of the A input geometry

Otherwise, null is returned to indicate full extent.

static bool geos::operation::overlayng::OverlayUtil::round ( const Point pt,
const PrecisionModel pm,
Coordinate rsltCoord 
)
static

Round the key point if precision model is fixed. Note: return value is only copied if rounding is performed.

static bool geos::operation::overlayng::OverlayUtil::safeEnv ( const Envelope env,
const PrecisionModel pm,
Envelope rsltEnvelope 
)
staticprivate
static double geos::operation::overlayng::OverlayUtil::safeExpandDistance ( const Envelope env,
const PrecisionModel pm 
)
staticprivate
static std::unique_ptr<Geometry> geos::operation::overlayng::OverlayUtil::toLines ( OverlayGraph graph,
bool  isOutputEdges,
const GeometryFactory geomFact 
)
static

Member Data Documentation

constexpr double geos::operation::overlayng::OverlayUtil::SAFE_ENV_BUFFER_FACTOR = 0.1
staticprivate

Definition at line 61 of file OverlayUtil.h.

constexpr int geos::operation::overlayng::OverlayUtil::SAFE_ENV_GRID_FACTOR = 3
staticprivate

Definition at line 62 of file OverlayUtil.h.


The documentation for this class was generated from the following file: