Class: IntersectionMatrix

jsts.geom.IntersectionMatrix

new IntersectionMatrix(elements)

Models a Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. This class is used to represent intersection matrices (such as "212FF1FF2") capturing the topological relationship between two Geometrys. It can also be represent patterns (such as "T*T******")for matching existing matrices. 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 to see if a matrix matches a given pattern string.

For a description of the DE-9IM, see the OpenGIS Simple Features Specification for SQL. The entries of the matrix are defined by the constants in the Dimension class. The indices of the matrix represent the topological locations that occur in a geometry (Interior, Boundary, Exterior). These are provided as constants in the Location class.

Parameters:
Name Type Description
elements string/IntersectionMatrix
Source:

Methods

(static) matches(actualDimensionValue, requiredDimensionSymbol) → {boolean}

Returns true if the dimension value satisfies the dimension symbol.
Parameters:
Name Type Description
actualDimensionValue int a number that can be stored in the IntersectionMatrix . Possible values are {TRUE, FALSE, DONTCARE, 0, 1, 2}.
requiredDimensionSymbol string a character used in the string representation of an IntersectionMatrix. Possible values are {T, F, * , 0, 1, 2}.
Source:
Returns:
true if the dimension symbol encompasses the dimension value.
Type
boolean

(static) matches2(actualDimensionSymbols, requiredDimensionSymbols) → {boolean}

Returns true if each of the actual dimension symbols satisfies the corresponding required dimension symbol.
Parameters:
Name Type Description
actualDimensionSymbols string nine dimension symbols to validate. Possible values are {T, F, * , 0, 1, 2}.
requiredDimensionSymbols string nine dimension symbols to validate against. Possible values are {T, F, * , 0, 1, 2}.
Source:
Returns:
true if each of the required dimension symbols encompass the corresponding actual dimension symbol.
Type
boolean

add(im)

Adds one matrix to another. Addition is defined by taking the maximum dimension value of each position in the summand matrices.
Parameters:
Name Type Description
im IntersectionMatrix the matrix to add.
Source:

get(row, column) → {int}

Returns the value of one of this matrix entries. The value of the provided index is one of the values from the Location class. The value returned is a constant from the Dimension class.
Parameters:
Name Type Description
row int the row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry.
column int the column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry.
Source:
Returns:
the dimension value at the given matrix position.
Type
int

isContains() → {boolean}

Tests whether this IntersectionMatrix is T*****FF*.
Source:
Returns:
true if the first Geometry contains the second.
Type
boolean

isCoveredBy() → {boolean}

Returns true if this IntersectionMatrix is T*F**F*** or *TF**F*** or **FT*F*** or **F*TF***
Source:
Returns:
true if the first Geometry is covered by the second.
Type
boolean

isCovers() → {boolean}

Returns true if this IntersectionMatrix is T*****FF* or *T****FF* or ***T**FF* or ****T*FF*
Source:
Returns:
true if the first Geometry covers the second.
Type
boolean

isCrosses(dimensionOfGeometryA, dimensionOfGeometryB) → {boolean}

Tests whether this geometry crosses the specified 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 is
    • T*T****** (for P/L, P/A, and L/A situations)
    • T*****T** (for L/P, L/A, and A/L situations)
    • 0******** (for L/L situations)
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.

Parameters:
Name Type Description
dimensionOfGeometryA int the dimension of the first Geometry.
dimensionOfGeometryB int the dimension of the second Geometry.
Source:
Returns:
true if the two Geometrys related by this IntersectionMatrix cross.
Type
boolean

isDisjoint() → {boolean}

Returns true if this IntersectionMatrix is FF*FF****.
Source:
Returns:
true if the two Geometrys related by this IntersectionMatrix are disjoint.
Type
boolean

isEquals(dimensionOfGeometryA, dimensionOfGeometryB) → {boolean}

Returns true if this IntersectionMatrix is T*F**FFF*.
Parameters:
Name Type Description
dimensionOfGeometryA int the dimension of the first Geometry.
dimensionOfGeometryB int the dimension of the second Geometry.
Source:
Returns:
true if the two Geometry s related by this IntersectionMatrix are equal; the Geometrys must have the same dimension for this function to return true.
Type
boolean

isIntersects() → {boolean}

Returns true if isDisjoint returns false.
Source:
Returns:
true if the two Geometrys related by this IntersectionMatrix intersect.
Type
boolean

isOverlaps(dimensionOfGeometryA, dimensionOfGeometryB) → {boolean}

Returns true if this IntersectionMatrix is
  • T*T***T** (for two points or two surfaces)
  • 1*T***T** (for two curves)
.
Parameters:
Name Type Description
dimensionOfGeometryA int the dimension of the first Geometry.
dimensionOfGeometryB int the dimension of the second Geometry.
Source:
Returns:
true if the two Geometrys related by this IntersectionMatrix overlap. For this function to return true, the Geometrys must be two points, two curves or two surfaces.
Type
boolean

isTouches(dimensionOfGeometryA, dimensionOfGeometryB) → {boolean}

Returns true if this IntersectionMatrix is FT*******, F**T***** or F***T****.
Parameters:
Name Type Description
dimensionOfGeometryA int the dimension of the first Geometry.
dimensionOfGeometryB int the dimension of the second Geometry.
Source:
Returns:
true if the two Geometry s related by this IntersectionMatrix touch; Returns false if both Geometrys are points.
Type
boolean

isWithin() → {boolean}

Tests whether this IntersectionMatrix is T*F**F***.
Source:
Returns:
true if the first Geometry is within the second.
Type
boolean

matches(requiredDimensionSymbols) → {boolean}

Returns whether the elements of this IntersectionMatrix satisfies the required dimension symbols.
Parameters:
Name Type Description
requiredDimensionSymbols string nine dimension symbols with which to compare the elements of this IntersectionMatrix. Possible values are {T, F, * , 0, 1, 2}.
Source:
Returns:
true if this IntersectionMatrix matches the required dimension symbols.
Type
boolean

set(row, column, dimensionValue)

Changes the value of one of this IntersectionMatrixs elements.
Parameters:
Name Type Description
row int the row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry.
column int the column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry.
dimensionValue int the new value of the element.
Source:

set2(dimensionSymbols)

Changes the elements of this IntersectionMatrix to the dimension symbols in dimensionSymbols.
Parameters:
Name Type Description
dimensionSymbols String nine dimension symbols to which to set this IntersectionMatrix s elements. Possible values are {T, F, * , 0, 1, 2}.
Source:

setAll(dimensionValue)

Changes the elements of this IntersectionMatrix to dimensionValue .
Parameters:
Name Type Description
dimensionValue int the dimension value to which to set this IntersectionMatrix s elements. Possible values {TRUE, FALSE, DONTCARE, 0, 1, 2} .
Source:

setAtLeast(row, column, minimumDimensionValue)

Changes the specified element to minimumDimensionValue if the element is less.
Parameters:
Name Type Description
row int the row of this IntersectionMatrix , indicating the interior, boundary or exterior of the first Geometry.
column int the column of this IntersectionMatrix , indicating the interior, boundary or exterior of the second Geometry.
minimumDimensionValue int the dimension value with which to compare the element. The order of dimension values from least to greatest is {DONTCARE, TRUE, FALSE, 0, 1, 2}.
Source:

setAtLeast2(minimumDimensionSymbols)

For each element in this IntersectionMatrix, changes the element to the corresponding minimum dimension symbol if the element is less.
Parameters:
Name Type Description
minimumDimensionSymbols string 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} .
Source:

setAtLeastIfValid(row, column, minimumDimensionValue)

If row >= 0 and column >= 0, changes the specified element to minimumDimensionValue if the element is less. Does nothing if row <0 or column < 0.
Parameters:
Name Type Description
row int the row of this IntersectionMatrix , indicating the interior, boundary or exterior of the first Geometry.
column int the column of this IntersectionMatrix , indicating the interior, boundary or exterior of the second Geometry.
minimumDimensionValue int the dimension value with which to compare the element. The order of dimension values from least to greatest is {DONTCARE, TRUE, FALSE, 0, 1, 2}.
Source:

toString() → {string}

Returns a nine-character String representation of this IntersectionMatrix .
Source:
Returns:
the nine dimension symbols of this IntersectionMatrix in row-major order.
Type
string

transpose() → {IntersectionMatrix}

Transposes this jsts.geom.IntersectionMatrix.
Source:
Returns:
this IntersectionMatrix as a convenience.
Type
IntersectionMatrix