Search Results for

    Show / Hide Table of Contents

    Class RelatePredicate

    Creates predicate instances for evaluating OGC-standard named topological relationships. Predicates can be evaluated for geometries using RelateNG.

    Inheritance
    object
    RelatePredicate
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Operation.RelateNG
    Assembly: NetTopologySuite.dll
    Syntax
    public static class RelatePredicate

    Methods

    | Edit this page View Source

    Contains()

    Creates a predicate to determine whether a geometry contains another geometry.

    The Contains predicate has the following equivalent definitions:
    • Every point of the other geometry is a point of this geometry, and the interiors of the two geometries have at least one point in common.
    • The DE-9IM Intersection Matrix for the two geometries matches the pattern [T*****FF*]
    • within(B, A) = true
      ( contains is the converse of Within())
    An implication of the definition is that "Geometries do not contain their boundary". In other words, if a geometry A is a subset of the points in the boundary of a geometry B, B.contains(A) = false. (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behavior but avoiding this subtle limitation, see Covers().
    Declaration
    public static TopologyPredicate Contains()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    See Also
    Within()
    | Edit this page View Source

    CoveredBy()

    Creates a predicate to determine whether a geometry is covered by another geometry.

    The CoveredBy predicate has the following equivalent definitions:
    • Every point of this geometry is a point of the other geometry.
    • The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns:
      • [T*F**F***]
      • [*TF**F***]
      • [**FT*F***]
      • [**F*TF***]
    • Covers(B, A) = true
      (CoveredBy is the converse of Covers())
    If either geometry is empty, the value of this predicate is false.

    This predicate is similar to {@link #within}, but is more inclusive (i.e. returns true for more cases).
    Declaration
    public static TopologyPredicate CoveredBy()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    See Also
    Covers()
    | Edit this page View Source

    Covers()

    Creates a predicate to determine whether a geometry covers another geometry.

    The Covers predicate has the following equivalent definitions:
    • Every point of the other geometry is a point of this geometry.
    • The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns:
      • [T*****FF*]
      • [*T****FF*]
      • [***T**FF*]
      • [****T*FF*]
    • CoveredBy(b, a) = true
      (Covers is the converse of CoveredBy())
    If either geometry is empty, the value of this predicate is false.

    This predicate is similar to Contains(), but is more inclusive (i.e. returns true for more cases). In particular, unlike Contains it does not distinguish between points in the boundary and in the interior of geometries. For most cases, Covers should be used in preference to Contains. As an added benefit, Covers is more amenable to optimization, and hence should be more performant.
    Declaration
    public static TopologyPredicate Covers()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    See Also
    CoveredBy()
    | Edit this page View Source

    Crosses()

    Creates a predicate to determine whether a geometry crosses another geometry.

    The Crosses predicate has the following equivalent definitions:
    • The geometries have some but not all interior points in common.
    • The DE-9IM Intersection Matrix for the two geometries matches one of the following patterns:
      • [TT*****] (for P/L, P/A, and L/A cases)
      • [TT] (for L/P, A/P, and A/L cases)
      • [0*****] (for L/L cases)
    For the A/A and P/P cases this predicate returns false.

    The SFS defined this predicate only for P/L, P/A, L/L, and L/A cases. To make the relation symmetric NTS extends the definition to apply to L/P, A/P and A/L cases as well.
    Declaration
    public static TopologyPredicate Crosses()
    Returns
    Type Description
    TopologyPredicate

    The crosses predicate

    | Edit this page View Source

    Disjoint()

    Creates a predicate to determine whether two geometries are disjoint.

    The Disjoint predicate has the following equivalent definitions:
    • The two geometries have no point in common
    • The DE-9IM Intersection Matrix for the two geometries matches [FF*FF****]
    • Intersects() = false
      (Disjoint is the inverse of Intersects)
    Declaration
    public static TopologyPredicate Disjoint()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    See Also
    Intersects()
    | Edit this page View Source

    EqualsTopologically()

    Creates a predicate to determine whether two geometries are topologically equal.

    The Equals predicate has the following equivalent definitions:
    • The two geometries have at least one point in common, and no point of either geometry lies in the exterior of the other geometry.
    • The DE-9IM Intersection Matrix for the two geometries matches the pattern T*F**FFF*
    Declaration
    public static TopologyPredicate EqualsTopologically()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    | Edit this page View Source

    Intersects()

    Creates a predicate to determine whether two geometries intersect.

    The Intersects predicate has the following equivalent definitions:
    • The two geometries have at least one point in common
    • The DE-9IM Intersection Matrix for the two geometries matches at least one of the patterns
      • [T********]
      • [*T*******]
      • [***T*****]
      • [****T****]
      Disjoint() = false
      (Intersects is the inverse of Disjoint)
    Declaration
    public static TopologyPredicate Intersects()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    See Also
    Disjoint()
    | Edit this page View Source

    Matches(string)

    Creates a predicate that matches a DE-9IM matrix pattern.

    Declaration
    public static TopologyPredicate Matches(string imPattern)
    Parameters
    Type Name Description
    string imPattern

    The pattern to match

    Returns
    Type Description
    TopologyPredicate

    A predicate that matches the pattern

    See Also
    IntersectionMatrixPattern
    | Edit this page View Source

    Overlaps()

    Creates a predicate to determine whether a geometry overlaps another geometry.

    The Overlaps predicate has the following equivalent definitions:
    • The geometries have at least one point each not shared by the other (or equivalently neither covers the other), they have the same dimension, and the intersection of the interiors of the two geometries has the same dimension as the geometries themselves.
    • The DE-9IM Intersection Matrix for the two geometries matches [T*T***T**] (for P/P and A/A cases) or [1*T***T**] (for L/L cases)
    If the geometries are of different dimension this predicate returns false. This predicate is symmetric.
    Declaration
    public static TopologyPredicate Overlaps()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    | Edit this page View Source

    Touches()

    Creates a predicate to determine whether a geometry touches another geometry.

    The Touches predicate has the following equivalent definitions:
    • The geometries have at least one point in common, but their interiors do not intersect.
    • The DE-9IM Intersection Matrix for the two geometries matches at least one of the following patterns
      • [FT*******]
      • [F**T*****]
      • [F***T****]
    If both geometries have dimension 0, the predicate returns false, since points have only interiors. This predicate is symmetric.
    Declaration
    public static TopologyPredicate Touches()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    | Edit this page View Source

    Within()

    Creates a predicate to determine whether a geometry is within another geometry.

    The Within predicate has the following equivalent definitions:
    • Every point of this geometry is a point of the other geometry, and the interiors of the two geometries have at least one point in common.
    • The DE-9IM Intersection Matrix for the two geometries matches [T*F**F***]
    • contains(B, A) = true
      (Within is the converse of Contains())
    An implication of the definition is that "The boundary of a Geometry is not within the Geometry". In other words, if a geometry A is a subset of the points in the boundary of a geometry B, within(B, A) = false (As a concrete example, take A to be a LineString which lies in the boundary of a Polygon B.) For a predicate with similar behavior but avoiding this subtle limitation, see CoveredBy().
    Declaration
    public static TopologyPredicate Within()
    Returns
    Type Description
    TopologyPredicate

    The predicate instance

    See Also
    Contains()
    CoveredBy()
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX