Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.vividsolutions.jts.geom.IntersectionMatrix
public class IntersectionMatrix
extends java.lang.Object
implements Cloneable
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
boolean |
|
static boolean |
|
static boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
IntersectionMatrix |
|
public IntersectionMatrix()
Creates anIntersectionMatrix
withFALSE
dimension values.
public IntersectionMatrix(String elements)
Creates anIntersectionMatrix
with the given dimension symbols.
- Parameters:
elements
- a String of nine dimension symbols in row major order
public IntersectionMatrix(IntersectionMatrix other)
Creates anIntersectionMatrix
with the same elements asother
.
- Parameters:
other
- anIntersectionMatrix
to copy
public void add(IntersectionMatrix im)
Adds one matrix to another. Addition is defined by taking the maximum dimension value of each position in the summand matrices.
- Parameters:
im
- the matrix to add
public int get(int row, int column)
Returns the value of one of thisIntersectionMatrix
s elements.
- Parameters:
row
- the row of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the firstGeometry
column
- the column of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the secondGeometry
- Returns:
- the dimension value at the given matrix position.
public boolean isContains()
Returnstrue
if thisIntersectionMatrix
is T*****FF*.
- Returns:
true
if the firstGeometry
contains the second
public boolean isCoveredBy()
Returnstrue
if thisIntersectionMatrix
isT*F**F***
or*TF**F***
or**FT*F***
or**F*TF***
- Returns:
true
if the firstGeometry
covers the second
public boolean isCovers()
Returnstrue
if thisIntersectionMatrix
isT*****FF*
or*T****FF*
or***T**FF*
or****T*FF*
- Returns:
true
if the firstGeometry
covers the second
public boolean isCrosses(int dimensionOfGeometryA, int dimensionOfGeometryB)
Returnstrue
if this geometry crosses the specified geometry. Thecrosses
predicate has the following equivalent definitions:For any other combination of dimensions this predicate returns
- 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)
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:
dimensionOfGeometryA
- the dimension of the firstGeometry
dimensionOfGeometryB
- the dimension of the secondGeometry
- Returns:
true
if the twoGeometry
s related by thisIntersectionMatrix
cross.
public boolean isDisjoint()
Returnstrue
if thisIntersectionMatrix
is FF*FF****.
- Returns:
true
if the twoGeometry
s related by thisIntersectionMatrix
are disjoint
public boolean isEquals(int dimensionOfGeometryA, int dimensionOfGeometryB)
Returnstrue
if thisIntersectionMatrix
is T*F**FFF*.
- Parameters:
dimensionOfGeometryA
- the dimension of the firstGeometry
dimensionOfGeometryB
- the dimension of the secondGeometry
- Returns:
true
if the twoGeometry
s related by thisIntersectionMatrix
are equal; theGeometry
s must have the same dimension for this function to returntrue
public boolean isIntersects()
Returnstrue
ifisDisjoint
returns false.
- Returns:
true
if the twoGeometry
s related by thisIntersectionMatrix
intersect
public boolean isOverlaps(int dimensionOfGeometryA, int dimensionOfGeometryB)
Returnstrue
if thisIntersectionMatrix
is.
- T*T***T** (for two points or two surfaces)
- 1*T***T** (for two curves)
- Parameters:
dimensionOfGeometryA
- the dimension of the firstGeometry
dimensionOfGeometryB
- the dimension of the secondGeometry
- Returns:
true
if the twoGeometry
s related by thisIntersectionMatrix
overlap. For this function to returntrue
, theGeometry
s must be two points, two curves or two surfaces.
public boolean isTouches(int dimensionOfGeometryA, int dimensionOfGeometryB)
Returnstrue
if thisIntersectionMatrix
is FT*******, F**T***** or F***T****.
- Parameters:
dimensionOfGeometryA
- the dimension of the firstGeometry
dimensionOfGeometryB
- the dimension of the secondGeometry
- Returns:
true
if the twoGeometry
s related by thisIntersectionMatrix
touch; Returns false if bothGeometry
s are points.
public boolean isWithin()
Returnstrue
if thisIntersectionMatrix
is T*F**F***.
- Returns:
true
if the firstGeometry
is within the second
public boolean matches(String requiredDimensionSymbols)
Returns whether the elements of thisIntersectionMatrix
satisfies the required dimension symbols.
- Parameters:
requiredDimensionSymbols
- nine dimension symbols with which to compare the elements of thisIntersectionMatrix
. Possible values are{T, F, * , 0, 1, 2}
.
- Returns:
true
if thisIntersectionMatrix
matches the required dimension symbols
public static boolean matches(String actualDimensionSymbols, String requiredDimensionSymbols)
Returns true if each of the actual dimension symbols satisfies the corresponding required dimension symbol.
- Parameters:
actualDimensionSymbols
- nine dimension symbols to validate. Possible values are{T, F, * , 0, 1, 2}
.requiredDimensionSymbols
- nine dimension symbols to validate against. Possible values are{T, F, * , 0, 1, 2}
.
- Returns:
- true if each of the required dimension symbols encompass the corresponding actual dimension symbol
public static boolean matches(int actualDimensionValue, char requiredDimensionSymbol)
Returns true if the dimension value satisfies the dimension symbol.
- Parameters:
actualDimensionValue
- a number that can be stored in theIntersectionMatrix
. Possible values are{TRUE, FALSE, DONTCARE, 0, 1, 2}
.requiredDimensionSymbol
- a character used in the string representation of anIntersectionMatrix
. Possible values are{T, F, * , 0, 1, 2}
.
- Returns:
- true if the dimension symbol encompasses the dimension value
public void set(String dimensionSymbols)
Changes the elements of thisIntersectionMatrix
to the dimension symbols indimensionSymbols
.
- Parameters:
dimensionSymbols
- nine dimension symbols to which to set thisIntersectionMatrix
s elements. Possible values are{T, F, * , 0, 1, 2}
public void set(int row, int column, int dimensionValue)
Changes the value of one of thisIntersectionMatrix
s elements.
- Parameters:
row
- the row of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the firstGeometry
column
- the column of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the secondGeometry
dimensionValue
- the new value of the element
public void setAll(int dimensionValue)
Changes the elements of thisIntersectionMatrix
todimensionValue
.
- Parameters:
dimensionValue
- the dimension value to which to set thisIntersectionMatrix
s elements. Possible values{TRUE, FALSE, DONTCARE, 0, 1, 2}
.
public void setAtLeast(String minimumDimensionSymbols)
For each element in thisIntersectionMatrix
, changes the element to the corresponding minimum dimension symbol if the element is less.
- Parameters:
minimumDimensionSymbols
- nine dimension symbols with which to compare the elements of thisIntersectionMatrix
. The order of dimension values from least to greatest is{DONTCARE, TRUE, FALSE, 0, 1, 2}
.
public void setAtLeast(int row, int column, int minimumDimensionValue)
Changes the specified element tominimumDimensionValue
if the element is less.
- Parameters:
row
- the row of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the firstGeometry
column
- the column of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the secondGeometry
minimumDimensionValue
- 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}
.
public void setAtLeastIfValid(int row, int column, int minimumDimensionValue)
If row >= 0 and column >= 0, changes the specified element tominimumDimensionValue
if the element is less. Does nothing if row <0 or column <320.
- Parameters:
row
- the row of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the firstGeometry
column
- the column of thisIntersectionMatrix
, indicating the interior, boundary or exterior of the secondGeometry
minimumDimensionValue
- 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}
.
public String toString()
Returns a nine-characterString
representation of thisIntersectionMatrix
.
- Returns:
- the nine dimension symbols of this
IntersectionMatrix
in row-major order.
public IntersectionMatrix transpose()
Transposes this IntersectionMatrix.
- Returns:
- this
IntersectionMatrix
as a convenience