Search Results for

    Show / Hide Table of Contents

    Class IntersectionMatrix

    Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.

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

    DE-9IM matrix values (such as "212FF1FF2") specify the topological relationship between two Geometrys. This class can also represent matrix patterns (such as "TT*****") which are used for matching instances of DE-9IM matrices.

    DE-9IM matrices are 3x3 matrices with integer entries. The matrix indices {0,1,2} represent the topological locations that occur in a geometry(Interior, Boundary, Exterior). These are provided by the constants Interior, Boundary, and Exterior.

    When used to specify the topological relationship between two geometries, the matrix entries represent the possible dimensions of each intersection: A = 2, L = 1, P = 0 and False = -1.
    When used to represent a matrix pattern entries can have the additional values True ("T") and Dontcare ("*").

    For a description of the DE-9IM and the spatial predicates derived from it, see the following references:
    • OGC 99-049 OpenGIS Simple Features Specification for SQL.
    • OGC 06-103r4 OpenGIS Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture, Section 6.1.15 (which provides some further details on certain predicate specifications).
    • Wikipedia article on DE-9IM

    Methods are provided to:
    • set and query the elements of the matrix in a convenient fashion
    • convert to and from the standard string representation(specified in SFS Section 2.1.13.2).
    • test if a matrix matches a given pattern string.
    • test if a matrix(possibly with geometry dimensions) matches a standard named spatial predicate

    Constructors

    | Edit this page View Source

    IntersectionMatrix()

    Creates an IntersectionMatrix with null location values.

    Declaration
    public IntersectionMatrix()
    | Edit this page View Source

    IntersectionMatrix(IntersectionMatrix)

    Creates an IntersectionMatrix with the same elements as other.

    Declaration
    public IntersectionMatrix(IntersectionMatrix other)
    Parameters
    Type Name Description
    IntersectionMatrix other

    An IntersectionMatrix to copy.

    | Edit this page View Source

    IntersectionMatrix(string)

    Creates an IntersectionMatrix with the given dimension symbols.

    Declaration
    public IntersectionMatrix(string elements)
    Parameters
    Type Name Description
    string elements

    A string of nine dimension symbols in row major order.

    Properties

    | Edit this page View Source

    this[Location, Location]

    See methods Get(int, int) and Set(int, int, int value)

    Declaration
    public Dimension this[Location row, Location column] { get; set; }
    Parameters
    Type Name Description
    Location row
    Location column
    Property Value
    Type Description
    Dimension

    Methods

    | Edit this page View Source

    Add(IntersectionMatrix)

    Adds one matrix to another. Addition is defined by taking the maximum dimension value of each position in the summand matrices.

    Declaration
    public void Add(IntersectionMatrix im)
    Parameters
    Type Name Description
    IntersectionMatrix im

    The matrix to add.

    | Edit this page View Source

    Get(Location, Location)

    Returns the value of one of this IntersectionMatrixs elements.

    Declaration
    public Dimension Get(Location row, Location column)
    Parameters
    Type Name Description
    Location row

    The row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry.

    Location column

    The column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry.

    Returns
    Type Description
    Dimension

    The dimension value at the given matrix position.

    | Edit this page View Source

    IsContains()

    Tests whether this matrix matches [T*****FF*]

    Declaration
    public bool IsContains()
    Returns
    Type Description
    bool

    true if the first Geometry contains the second.

    | Edit this page View Source

    IsCoveredBy()

    Tests if this matrix matches [TFF] or [TFF] or [FTF] or [FTF].

    Declaration
    public bool IsCoveredBy()
    Returns
    Type Description
    bool

    true if the first Geometry is covered by the second

    | Edit this page View Source

    IsCovers()

    Tests if this matrix matches [T**FF*] or [TFF*] or [TFF] or [**TFF].

    Declaration
    public bool IsCovers()
    Returns
    Type Description
    bool

    true if the first Geometry covers the second

    | Edit this page View Source

    IsCrosses(Dimension, Dimension)

    Tests whether this geometry crosses the specified geometry.

    Declaration
    public bool IsCrosses(Dimension dimensionOfGeometryA, Dimension dimensionOfGeometryB)
    Parameters
    Type Name Description
    Dimension dimensionOfGeometryA

    The dimension of the first Geometry.

    Dimension dimensionOfGeometryB

    The dimension of the second Geometry.

    Returns
    Type Description
    bool

    true if the two Geometry s related by this matrix cross.

    Remarks

    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
    For any other combination of dimensions this predicate returns false.

    The SFS defined this predicate only for P/L, P/A, L/L, and L/A situations. JTS extends the definition to apply to L/P, A/P and A/L situations as well. This makes the relation symmetric.
    | Edit this page View Source

    IsDisjoint()

    Tests if this matrix matches [FFFF***].

    Declaration
    public bool IsDisjoint()
    Returns
    Type Description
    bool

    true if the two Geometry's related by this matrix are disjoint.

    | Edit this page View Source

    IsEquals(Dimension, Dimension)

    Tests whether the argument dimensions are equal and this matrix matches the pattern [TF**FFF].

    Note: This pattern differs from the one stated in Simple feature access - Part 1: Common architecture. That document states the pattern as [TFFFTFFFT]. This would specify that two identical POINTs are not equal, which is not desirable behaviour. The pattern used here has been corrected to compute equality in this situation.
    Declaration
    public bool IsEquals(Dimension dimensionOfGeometryA, Dimension dimensionOfGeometryB)
    Parameters
    Type Name Description
    Dimension dimensionOfGeometryA

    The dimension of the first Geometry.

    Dimension dimensionOfGeometryB

    The dimension of the second Geometry.

    Returns
    Type Description
    bool

    true if the two Geometrys related by this matrix are equal; the Geometrys must have the same dimension to be equal.

    | Edit this page View Source

    IsIntersects()

    Tests if isDisjoint returns false.

    Declaration
    public bool IsIntersects()
    Returns
    Type Description
    bool

    true if the two Geometry's related by this matrix intersect.

    | Edit this page View Source

    IsOverlaps(Dimension, Dimension)

    Tests if this matrix matches

    • [T*T***T**] (for two points or two surfaces)
    • [1*T***T**] (for two curves)
    Declaration
    public bool IsOverlaps(Dimension dimensionOfGeometryA, Dimension dimensionOfGeometryB)
    Parameters
    Type Name Description
    Dimension dimensionOfGeometryA

    The dimension of the first Geometry.

    Dimension dimensionOfGeometryB

    The dimension of the second Geometry.

    Returns
    Type Description
    bool

    true if the two Geometry s related by this matrix overlap. For this function to return true, the Geometrys must be two points, two curves or two surfaces.

    | Edit this page View Source

    IsTouches(Dimension, Dimension)

    Tests if this matrix matches [FT*******], [FT***] or [FT*].

    Declaration
    public bool IsTouches(Dimension dimensionOfGeometryA, Dimension dimensionOfGeometryB)
    Parameters
    Type Name Description
    Dimension dimensionOfGeometryA

    The dimension of the first Geometry.

    Dimension dimensionOfGeometryB

    The dimension of the second Geometry.

    Returns
    Type Description
    bool

    true if the two Geometry s related by this matrix touch; Returns false if both Geometrys are points.

    | Edit this page View Source

    IsTrue(Dimension)

    Tests if the dimension value matches TRUE (i.e. has value 0, 1, 2 or TRUE).

    Declaration
    public static bool IsTrue(Dimension actualDimensionValue)
    Parameters
    Type Name Description
    Dimension actualDimensionValue

    A number that can be stored in the IntersectionMatrix. Possible values are {True, False, Dontcare, Point, Curve, Surface}

    Returns
    Type Description
    bool

    true if the dimension value matches True

    | Edit this page View Source

    IsWithin()

    Tests whether this matrix matches [TFF].

    Declaration
    public bool IsWithin()
    Returns
    Type Description
    bool

    true if the first Geometry is within the second.

    | Edit this page View Source

    Matches(Dimension, char)

    Tests if the dimension value satisfies the dimension symbol.

    Declaration
    public static bool Matches(Dimension actualDimensionValue, char requiredDimensionSymbol)
    Parameters
    Type Name Description
    Dimension actualDimensionValue

    a number that can be stored in the IntersectionMatrix. Possible values are {True, False, Dontcare, 0, 1, 2}.

    char requiredDimensionSymbol

    A character used in the string representation of an IntersectionMatrix. Possible values are T, F, * , 0, 1, 2.

    Returns
    Type Description
    bool

    true if the dimension symbol encompasses the dimension value.

    | Edit this page View Source

    Matches(string)

    Tests whether this matrix matches the given matrix pattern

    Declaration
    public bool Matches(string pattern)
    Parameters
    Type Name Description
    string pattern

    A pattern containing nine dimension symbols with which to compare the entries of this matrix.Possible symbol values are { T, F, * , 0, 1, 2}.

    Returns
    Type Description
    bool

    true if this IntersectionMatrix matches the required dimension symbols.

    | Edit this page View Source

    Matches(string, string)

    Tests if each of the actual dimension symbols in a matrix string satisfies the corresponding required dimension symbol in a pattern string.

    Declaration
    public static bool Matches(string actualDimensionSymbols, string requiredDimensionSymbols)
    Parameters
    Type Name Description
    string actualDimensionSymbols

    Nine dimension symbols to validate. Possible values are T, F, * , 0, 1, 2.

    string requiredDimensionSymbols

    Nine dimension symbols to validate against. Possible values are T, F, * , 0, 1, 2.

    Returns
    Type Description
    bool

    true if each of the required dimension symbols encompass the corresponding actual dimension symbol.

    | Edit this page View Source

    Set(Location, Location, Dimension)

    Changes the value of one of this IntersectionMatrix elements.

    Declaration
    public void Set(Location row, Location column, Dimension dimensionValue)
    Parameters
    Type Name Description
    Location row

    The row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry

    Location column

    The column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry

    Dimension dimensionValue

    The new value of the element

    | Edit this page View Source

    Set(string)

    Changes the elements of this IntersectionMatrix to the dimension symbols in dimensionSymbols.

    Declaration
    public void Set(string dimensionSymbols)
    Parameters
    Type Name Description
    string dimensionSymbols

    Nine dimension symbols to which to set this IntersectionMatrix s elements. Possible values are {T, F, * , 0, 1, 2}

    | Edit this page View Source

    SetAll(Dimension)

    Changes the elements of this IntersectionMatrix to dimensionValue.

    Declaration
    public void SetAll(Dimension dimensionValue)
    Parameters
    Type Name Description
    Dimension dimensionValue

    The dimension value to which to set this IntersectionMatrix s elements. Possible values True, False, Dontcare, 0, 1, 2}.

    | Edit this page View Source

    SetAtLeast(Location, Location, Dimension)

    Changes the specified element to minimumDimensionValue if the element is less.

    Declaration
    public void SetAtLeast(Location row, Location column, Dimension minimumDimensionValue)
    Parameters
    Type Name Description
    Location row

    The row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry.

    Location column

    The column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry.

    Dimension minimumDimensionValue

    The dimension value with which to compare the element. The order of dimension values from least to greatest is True, False, Dontcare, 0, 1, 2.

    | Edit this page View Source

    SetAtLeast(string)

    For each element in this IntersectionMatrix, changes the element to the corresponding minimum dimension symbol if the element is less.

    Declaration
    public void SetAtLeast(string minimumDimensionSymbols)
    Parameters
    Type Name Description
    string minimumDimensionSymbols

    Nine dimension symbols with which to compare the elements of this IntersectionMatrix. The order of dimension values from least to greatest is Dontcare, True, False, 0, 1, 2.

    | Edit this page View Source

    SetAtLeastIfValid(Location, Location, Dimension)

    If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue if the element is less. Does nothing if row is smaller to 0 or column is smaller to 0.

    Declaration
    public void SetAtLeastIfValid(Location row, Location column, Dimension minimumDimensionValue)
    Parameters
    Type Name Description
    Location row
    Location column
    Dimension minimumDimensionValue
    | Edit this page View Source

    ToString()

    Returns a nine-character String representation of this IntersectionMatrix.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The nine dimension symbols of this IntersectionMatrix in row-major order.

    Overrides
    object.ToString()
    | Edit this page View Source

    Transpose()

    Transposes this IntersectionMatrix.

    Declaration
    public IntersectionMatrix Transpose()
    Returns
    Type Description
    IntersectionMatrix

    This IntersectionMatrix as a convenience,

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX