GEOS 3.11.1
|
An interface for classes which prepare Geometry
s in order to optimize the performance of repeated calls to specific geometric operations.
More...
#include <PreparedGeometry.h>
Public Member Functions | |
virtual const geom::Geometry & | getGeometry () const =0 |
Gets the original Geometry which has been prepared. More... | |
virtual bool | contains (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry contains a given geometry. More... | |
virtual bool | containsProperly (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry properly contains a given geometry. More... | |
virtual bool | coveredBy (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry is covered by a given geometry. More... | |
virtual bool | covers (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry covers a given geometry. More... | |
virtual bool | crosses (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry crosses a given geometry. More... | |
virtual bool | disjoint (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry is disjoint from a given geometry. More... | |
virtual bool | intersects (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry intersects a given geometry. More... | |
virtual bool | overlaps (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry overlaps a given geometry. More... | |
virtual bool | touches (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry touches a given geometry. More... | |
virtual bool | within (const geom::Geometry *geom) const =0 |
Tests whether the base Geometry is within a given geometry. More... | |
virtual std::unique_ptr< geom::CoordinateSequence > | nearestPoints (const geom::Geometry *geom) const =0 |
Compute the nearest locations on the base Geometry and the given geometry. More... | |
virtual double | distance (const geom::Geometry *geom) const =0 |
Compute the minimum distance between the base Geometry and the given geometry. More... | |
virtual bool | isWithinDistance (const geom::Geometry *geom, double dist) const =0 |
Tests whether the base Geometry is within a given distance from the given geometry. More... | |
An interface for classes which prepare Geometry
s in order to optimize the performance of repeated calls to specific geometric operations.
A given implementation may provide optimized implementations for only some of the specified methods, and delegate the remaining methods to the original Geometry
operations. An implementation may also only optimize certain situations, and delegate others. See the implementing classes for documentation about which methods and situations they optimize.
|
pure virtual |
Tests whether the base Geometry
contains a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry, and geos::geom::prep::PreparedPolygon.
|
pure virtual |
Tests whether the base Geometry
properly contains a given geometry.
The containsProperly
predicate has the following equivalent definitions:
[T**FF*FF*]
In other words, if the test geometry has any interaction with the boundary of the target geometry the result of containsProperly
is false
. This is different semantics to the Geometry::contains
predicate, in which test geometries can intersect the target's boundary and still be contained.
The advantage of using this predicate is that it can be computed efficiently, since it avoids the need to compute the full topological relationship of the input boundaries in cases where they intersect.
An example use case is computing the intersections of a set of geometries with a large polygonal geometry. Since intersection
is a fairly slow operation, it can be more efficient to use containsProperly
to filter out test geometries which lie wholly inside the area. In these cases the intersection is known a priori to be exactly the original test geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry, and geos::geom::prep::PreparedPolygon.
|
pure virtual |
Tests whether the base Geometry
is covered by a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Tests whether the base Geometry
covers a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry, and geos::geom::prep::PreparedPolygon.
|
pure virtual |
Tests whether the base Geometry
crosses a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Tests whether the base Geometry
is disjoint from a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Compute the minimum distance between the base Geometry
and the given geometry.
geom | the Geometry to compute the distance to |
Implemented in geos::geom::prep::BasicPreparedGeometry, geos::geom::prep::PreparedLineString, and geos::geom::prep::PreparedPolygon.
|
pure virtual |
Gets the original Geometry
which has been prepared.
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Tests whether the base Geometry
intersects a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry, geos::geom::prep::PreparedLineString, geos::geom::prep::PreparedPoint, and geos::geom::prep::PreparedPolygon.
|
pure virtual |
Tests whether the base Geometry
is within a given distance from the given geometry.
geom | the Geometry to test the distance to |
dist | the distance value to compare |
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Compute the nearest locations on the base Geometry
and the given geometry.
geom | the Geometry to compute the nearest point to |
Implemented in geos::geom::prep::BasicPreparedGeometry, and geos::geom::prep::PreparedLineString.
|
pure virtual |
Tests whether the base Geometry
overlaps a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Tests whether the base Geometry
touches a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry.
|
pure virtual |
Tests whether the base Geometry
is within a given geometry.
geom | the Geometry to test |
Implemented in geos::geom::prep::BasicPreparedGeometry.