Class RelateNG
Computes the value of topological predicates between two geometries based on the Dimensionally - Extended 9-Intersection Model(DE-9IM). Standard and custom topological predicates are provided by RelatePredicate.
The RelateNG algorithm has the following capabilities:- Efficient short-circuited evaluation of topological predicates (including matching custom DE-9IM matrix patterns)
- Optimized repeated evaluation of predicates against a single geometry via cached spatial indexes (AKA "prepared mode")
- Robust computation (only point-local topology is required, so invalid geometry topology does not cause failures)
- GeometryCollection inputs containing mixed types and overlapping polygons are supported, using union semantics.
- Zero - length LineStrings are treated as being topologically identical to Points.
- Support for IBoundaryNodeRules.
See IntersectionMatrixPattern for a description of DE - 9IM patterns.
If not specified, the standard BoundaryNodeRules.Mod2BoundaryNodeRule is used. RelateNG operates in 2D only; it ignores any Z ordinates.
This implementation replaces RelateOp and IPreparedGeometry.
FUTURE WORK
- Support for a distance tolerance to provide "approximate" predicate evaluation
Inherited Members
Namespace: NetTopologySuite.Operation.RelateNG
Assembly: NetTopologySuite.dll
Syntax
public class RelateNG
Methods
| Edit this page View SourceEvaluate(Geometry)
Computes the DE-9IM matrix for the topological relationship to a geometry.
Declaration
public IntersectionMatrix Evaluate(Geometry b)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | b | The B geometry |
Returns
| Type | Description |
|---|---|
| IntersectionMatrix | the DE-9IM matrix |
Evaluate(Geometry, TopologyPredicate)
Tests whether the topological relationship to a geometry satisfies a topology predicate.
Declaration
public bool Evaluate(Geometry b, TopologyPredicate predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | b | The B geometry |
| TopologyPredicate | predicate | The topological predicate |
Returns
| Type | Description |
|---|---|
| bool |
|
Evaluate(Geometry, string)
Tests whether the topological relationship to a geometry matches a DE-9IM matrix pattern.
Declaration
public bool Evaluate(Geometry b, string imPattern)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | b | The B geometry |
| string | imPattern |
Returns
| Type | Description |
|---|---|
| bool |
|
See Also
| Edit this page View SourcePrepare(Geometry)
Creates a prepared RelateNG instance to optimize the evaluation of relationships against a single geometry.
Declaration
public static RelateNG Prepare(Geometry a)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
Returns
| Type | Description |
|---|---|
| RelateNG | A prepared instance |
Prepare(Geometry, IBoundaryNodeRule)
Creates a prepared RelateNG instance to optimize the computation of predicates against a single geometry, using a given IBoundaryNodeRule.
Declaration
public static RelateNG Prepare(Geometry a, IBoundaryNodeRule bnRule)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
| IBoundaryNodeRule | bnRule | The Boundary Node Rule to use |
Returns
| Type | Description |
|---|---|
| RelateNG | A prepared instance |
Relate(Geometry, Geometry)
Computes the DE-9IM matrix for the topological relationship between two geometries.
Declaration
public static IntersectionMatrix Relate(Geometry a, Geometry b)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
| Geometry | b | The B input geometry |
Returns
| Type | Description |
|---|---|
| IntersectionMatrix | The DE-9IM matrix for the topological relationship |
Relate(Geometry, Geometry, IBoundaryNodeRule)
Computes the DE-9IM matrix for the topological relationship between two geometries.
Declaration
public static IntersectionMatrix Relate(Geometry a, Geometry b, IBoundaryNodeRule bnRule)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
| Geometry | b | The B input geometry |
| IBoundaryNodeRule | bnRule | The Boundary Node Rule to use |
Returns
| Type | Description |
|---|---|
| IntersectionMatrix | The DE-9IM matrix for the topological relationship |
Relate(Geometry, Geometry, TopologyPredicate)
Tests whether the topological relationship between two geometries satisfies a topological predicate.
Declaration
public static bool Relate(Geometry a, Geometry b, TopologyPredicate pred)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
| Geometry | b | The B input geometry |
| TopologyPredicate | pred | The topological predicate |
Returns
| Type | Description |
|---|---|
| bool |
|
Relate(Geometry, Geometry, TopologyPredicate, IBoundaryNodeRule)
Tests whether the topological relationship between two geometries satisfies a topological predicate, using a given IBoundaryNodeRule.
Declaration
public static bool Relate(Geometry a, Geometry b, TopologyPredicate pred, IBoundaryNodeRule bnRule)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
| Geometry | b | The B input geometry |
| TopologyPredicate | pred | The topological predicate |
| IBoundaryNodeRule | bnRule | The Boundary Node Rule to use |
Returns
| Type | Description |
|---|---|
| bool |
|
Relate(Geometry, Geometry, string)
Tests whether the topological relationship to a geometry matches a DE-9IM matrix pattern.
Declaration
public static bool Relate(Geometry a, Geometry b, string imPattern)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry | a | The A input geometry |
| Geometry | b | The B input geometry |
| string | imPattern | The DE-9IM pattern to match |
Returns
| Type | Description |
|---|---|
| bool |
|