Interface IPreparedGeometry
An interface for classes which prepare Geometrys in order to optimize the performance of repeated calls to specific geometric operations.
Namespace: NetTopologySuite.Geometries.Prepared
Assembly: NetTopologySuite.dll
Syntax
public interface IPreparedGeometry
Remarks
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.
Subclasses are intended to be thread-safe, to allow IPreparedGeometry
to be used in a multi-threaded context
(which allows extracting maximum benefit from the prepared state).
Properties
| Edit this page View SourceGeometry
Gets the original Geometry which has been prepared.
Declaration
Geometry Geometry { get; }
Property Value
| Type | Description |
|---|---|
| Geometry |
Methods
| Edit this page View SourceContains(Geometry)
Tests whether the base Geometry contains a given geometry.
Declaration
bool Contains(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The Geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this Geometry contains the given Geometry |
ContainsProperly(Geometry)
Tests whether the base Geometry contains a given geometry.
Declaration
bool ContainsProperly(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry properly contains the given geometry |
Remarks
The ContainsProperly predicate has the following equivalent definitions:
- Every point of the other geometry is a point of this geometry's interior.
- The DE-9IM Intersection Matrix for the two geometries matches
>[T**FF*FF*]
An example use case for this predicate 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 known a priori to be simply the original test geometry.
CoveredBy(Geometry)
Tests whether the base Geometry is covered by a given geometry.
Declaration
bool CoveredBy(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry is covered by the given geometry |
Covers(Geometry)
Tests whether the base Geometry covers a given geometry.
Declaration
bool Covers(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry covers the given geometry |
Crosses(Geometry)
Tests whether the base Geometry crosses a given geometry.
Declaration
bool Crosses(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry crosses the given geometry |
Disjoint(Geometry)
Tests whether the base Geometry is disjoint from given geometry.
Declaration
bool Disjoint(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry is disjoint from the given geometry |
Remarks
This method supports GeometryCollections as input
Intersects(Geometry)
Tests whether the base Geometry intersects a given geometry.
Declaration
bool Intersects(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry intersects the given geometry |
Remarks
This method supports GeometryCollections as input
Overlaps(Geometry)
Tests whether the base Geometry overlaps a given geometry.
Declaration
bool Overlaps(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry overlaps the given geometry |
Touches(Geometry)
Tests whether the base Geometry touches a given geometry.
Declaration
bool Touches(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry touches the given geometry |
Within(Geometry)
Tests whether the base Geometry is within a given geometry.
Declaration
bool Within(Geometry geom)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | geom | The geometry to test |
Returns
| Type | Description |
|---|---|
| bool | true if this geometry is within the given geometry |