GEOS  3.13.0dev
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
geos::geom::prep::AbstractPreparedPolygonContains Class Referenceabstract

A base class containing the logic for computes the contains and covers spatial relationship predicates for a PreparedPolygon relative to all other Geometry classes. More...

#include <AbstractPreparedPolygonContains.h>

Inheritance diagram for geos::geom::prep::AbstractPreparedPolygonContains:
geos::geom::prep::PreparedPolygonPredicate geos::geom::prep::PreparedPolygonContains geos::geom::prep::PreparedPolygonCovers

Public Member Functions

 AbstractPreparedPolygonContains (const PreparedPolygon *const p_prepPoly)
 
 AbstractPreparedPolygonContains (const PreparedPolygon *const p_prepPoly, bool p_requireSomePointInInterior)
 
- Public Member Functions inherited from geos::geom::prep::PreparedPolygonPredicate
 PreparedPolygonPredicate (const PreparedPolygon *const p_prepPoly)
 Creates an instance of this operation. More...
 

Protected Member Functions

bool eval (const geom::Geometry *geom)
 
bool evalPointTestGeom (const geom::Geometry *geom, geom::Location outermostLoc)
 
virtual bool fullTopologicalPredicate (const geom::Geometry *geom)=0
 
- Protected Member Functions inherited from geos::geom::prep::PreparedPolygonPredicate
geom::Location getOutermostTestComponentLocation (const geom::Geometry *testGeom) const
 Returns the outermost Location among a test point from each components of the test geometry. More...
 
bool isAllTestComponentsInTargetInterior (const geom::Geometry *testGeom) const
 Tests whether all components of the test Geometry are contained in the interior of the target geometry. More...
 
bool isAnyTestComponentInTarget (const geom::Geometry *testGeom) const
 Tests whether any component of the test Geometry intersects the area of the target geometry. More...
 
bool isAnyTestComponentInTargetInterior (const geom::Geometry *testGeom) const
 Tests whether any component of the test Geometry intersects the interior of the target geometry. More...
 
bool isAnyTargetComponentInAreaTest (const geom::Geometry *testGeom, const std::vector< const geom::CoordinateXY * > *targetRepPts) const
 

Protected Attributes

bool requireSomePointInInterior
 
- Protected Attributes inherited from geos::geom::prep::PreparedPolygonPredicate
const PreparedPolygon *const prepPoly
 

Detailed Description

A base class containing the logic for computes the contains and covers spatial relationship predicates for a PreparedPolygon relative to all other Geometry classes.

Uses short-circuit tests and indexing to improve performance.

Contains and covers are very similar, and differ only in how certain cases along the boundary are handled. These cases require full topological evaluation to handle, so all the code in this class is common to both predicates.

It is not possible to short-circuit in all cases, in particular in the case where line segments of the test geometry touches the polygon linework. In this case full topology must be computed. (However, if the test geometry consists of only points, this can be evaluated in an optimized fashion.

Author
Martin Davis

Member Function Documentation

◆ eval()

bool geos::geom::prep::AbstractPreparedPolygonContains::eval ( const geom::Geometry geom)
protected

Evaluate the contains or covers relationship for the given geometry.

Parameters
geomthe test geometry
Returns
true if the test geometry is contained

Referenced by geos::geom::prep::PreparedPolygonContains::contains(), and geos::geom::prep::PreparedPolygonCovers::covers().

◆ evalPointTestGeom()

bool geos::geom::prep::AbstractPreparedPolygonContains::evalPointTestGeom ( const geom::Geometry geom,
geom::Location  outermostLoc 
)
protected

Evaluate the contains or covers relationship for the given Puntal geometry.

Parameters
geomthe test geometry
outermostLocoutermost Location of all points in geom
Returns
true if the test geometry is contained/covered in the target

◆ fullTopologicalPredicate()

virtual bool geos::geom::prep::AbstractPreparedPolygonContains::fullTopologicalPredicate ( const geom::Geometry geom)
protectedpure virtual

Computes the full topological predicate. Used when short-circuit tests are not conclusive.

Parameters
geomthe test geometry
Returns
true if this prepared polygon has the relationship with the test geometry

Implemented in geos::geom::prep::PreparedPolygonCovers, and geos::geom::prep::PreparedPolygonContains.

Member Data Documentation

◆ requireSomePointInInterior

bool geos::geom::prep::AbstractPreparedPolygonContains::requireSomePointInInterior
protected

This flag controls a difference between contains and covers.

For contains the value is true. For covers the value is false.


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