Search Results for

    Show / Hide Table of Contents

    Class GeometryRelate

    Class which provides the available Relate operations for NtsGeometryServices.

    Inheritance
    object
    GeometryRelate
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Geometries
    Assembly: NetTopologySuite.dll
    Syntax
    public abstract class GeometryRelate

    Properties

    | Edit this page View Source

    Legacy

    Gets a value indicating a geometry relation predicate computation class that uses old NTS relate function set.

    Declaration
    public static GeometryRelate Legacy { get; }
    Property Value
    Type Description
    GeometryRelate
    | Edit this page View Source

    NG

    Gets a value indicating a geometry relation predicate computation class that uses next-generation NTS relate function set.

    Declaration
    public static GeometryRelate NG { get; }
    Property Value
    Type Description
    GeometryRelate

    Methods

    | Edit this page View Source

    Contains(Geometry, Geometry)

    Tests if the input geometry a contains the input geometry b.

    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(Geometry, Geometry))
    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(Geometry, Geometry).
    Declaration
    public abstract bool Contains(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if the geometry a contains b.

    See Also
    Within(Geometry, Geometry)
    | Edit this page View Source

    CoveredBy(Geometry, Geometry)

    Tests if the input geometry a is covered by the input geometry b

    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(Geometry, Geometry))
    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 abstract bool CoveredBy(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    trueif the geometry a is covered by b

    See Also
    Covers(Geometry, Geometry)
    | Edit this page View Source

    Covers(Geometry, Geometry)

    Tests if the input geometry a covers the input geometry b

    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(Geometry, Geometry))
    If either geometry is empty, the value of this predicate is false.

    This predicate is similar to Contains(Geometry, Geometry), 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 abstract bool Covers(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if the geometry a covers b.

    See Also
    CoveredBy(Geometry, Geometry)
    | Edit this page View Source

    Crosses(Geometry, Geometry)

    Tests if the input geometry a crosses the input geometry b

    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:
      • [T*T******] (for P/L, P/A, and L/A cases)
      • [T*****T**] (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 abstract bool Crosses(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if the geometry a crosses b

    | Edit this page View Source

    Disjoint(Geometry, Geometry)

    Tests if the input geometry a and b 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 abstract bool Disjoint(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true> if geometries a and b are disjoint.

    See Also
    Intersects(Geometry, Geometry)
    | Edit this page View Source

    EqualsTopologically(Geometry, Geometry)

    Tests if the input geometry a and b 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 abstract bool EqualsTopologically(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if the geometries a and b are topologically equal

    | Edit this page View Source

    Intersects(Geometry, Geometry)

    Tests if the input geometries a and b 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 abstract bool Intersects(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if geometries a and b intersect.

    See Also
    Disjoint(Geometry, Geometry)
    | Edit this page View Source

    Overlaps(Geometry, Geometry)

    Test if the input geometry a overlaps the input geometry b.

    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 abstract bool Overlaps(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if the geometry a overlaps b

    | Edit this page View Source

    Relate(Geometry, Geometry)

    Computes the DE-9IM matrix for the topological relationship between two geometries.

    Declaration
    public abstract 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

    | Edit this page View Source

    Relate(Geometry, Geometry, string)

    Tests if the input geometry b relates to a in the way defined by intersectionPattern

    Declaration
    public abstract bool Relate(Geometry a, Geometry b, string intersectionPattern)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    string intersectionPattern

    The encoded DE-9IM pattern describing the topological relation to test

    Returns
    Type Description
    bool

    true if the geometry b relates to a in the way defined by intersectionPattern.

    | Edit this page View Source

    Touches(Geometry, Geometry)

    Tests if the input geometry a touches the b.

    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 abstract bool Touches(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if geometry a touches b

    | Edit this page View Source

    Within(Geometry, Geometry)

    Tests if the the input geometry a is within the input geometry b.

    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(Geometry, Geometry))
    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(Geometry, Geometry).
    Declaration
    public abstract bool Within(Geometry a, Geometry b)
    Parameters
    Type Name Description
    Geometry a

    The A input geometry

    Geometry b

    The B input geometry

    Returns
    Type Description
    bool

    true if the geometry a is within b.

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