#include <IntersectionMatrix.h>
Public Member Functions | |
IntersectionMatrix () | |
Default constructor. | |
IntersectionMatrix (const std::string &elements) | |
Overriden constructor. | |
IntersectionMatrix (const IntersectionMatrix &other) | |
Copy constructor. | |
bool | matches (const std::string &requiredDimensionSymbols) const |
Returns whether the elements of this IntersectionMatrix satisfies the required dimension symbols. | |
void | add (IntersectionMatrix *other) |
Adds one matrix to another. | |
void | set (int row, int column, int dimensionValue) |
Changes the value of one of this IntersectionMatrixs elements. | |
void | set (const std::string &dimensionSymbols) |
Changes the elements of this IntersectionMatrix to the dimension symbols in dimensionSymbols. | |
void | setAtLeast (int row, int column, int minimumDimensionValue) |
Changes the specified element to minimumDimensionValue if the element is less. | |
void | setAtLeastIfValid (int row, int column, int 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. | |
void | setAtLeast (std::string minimumDimensionSymbols) |
For each element in this IntersectionMatrix, changes the element to the corresponding minimum dimension symbol if the element is less. | |
void | setAll (int dimensionValue) |
Changes the elements of this IntersectionMatrix to dimensionValue. | |
int | get (int row, int column) const |
Returns the value of one of this IntersectionMatrixs elements. | |
bool | isDisjoint () const |
Returns true if this IntersectionMatrix is FF*FF****. | |
bool | isIntersects () const |
Returns true if isDisjoint returns false. | |
bool | isTouches (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is FT*******, F**T***** or F***T****. | |
bool | isCrosses (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is:
| |
bool | isWithin () const |
Returns true if this IntersectionMatrix is T*F**F***. | |
bool | isContains () const |
Returns true if this IntersectionMatrix is T*****FF*. | |
bool | isEquals (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is T*F**FFF*. | |
bool | isOverlaps (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is:
| |
bool | isCovers () const |
Returns true if this IntersectionMatrix is T*****FF* or *T****FF* or ***T**FF* or ****T*FF* . | |
bool | isCoveredBy () const |
Returns true if this IntersectionMatrix is T*F**F*** *TF**F*** or **FT*F*** or **F*TF*** . | |
IntersectionMatrix * | transpose () |
Transposes this IntersectionMatrix. | |
std::string | toString () const |
Returns a nine-character String representation of this IntersectionMatrix. | |
Static Public Member Functions | |
static bool | matches (int actualDimensionValue, char requiredDimensionSymbol) |
Tests if given dimension value satisfies the dimension symbol. | |
static bool | matches (const std::string &actualDimensionSymbols, const std::string &requiredDimensionSymbols) |
Returns true if each of the actual dimension symbols satisfies the corresponding required dimension symbol. |
Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. This class can used to represent both computed DE-9IM's (like 212FF1FF2) as well as patterns for matching them (like T*T******).
Methods are provided to:
For a description of the DE-9IM, see the OpenGIS Simple Features Specification for SQL.
geos::geom::IntersectionMatrix::IntersectionMatrix | ( | ) |
Default constructor.
Creates an IntersectionMatrix with Dimension::False dimension values ('F').
geos::geom::IntersectionMatrix::IntersectionMatrix | ( | const std::string & | elements | ) |
Overriden constructor.
Creates an IntersectionMatrix with the given dimension symbols.
elements | - reference to string containing pattern of dimension values for elements. |
geos::geom::IntersectionMatrix::IntersectionMatrix | ( | const IntersectionMatrix & | other | ) |
Copy constructor.
Creates an IntersectionMatrix with the same elements as other.
bool geos::geom::IntersectionMatrix::matches | ( | const std::string & | requiredDimensionSymbols | ) | const |
Returns whether the elements of this IntersectionMatrix satisfies the required dimension symbols.
requiredDimensionSymbols | - nine dimension symbols with which to compare the elements of this IntersectionMatrix. Possible values are {T, F, * , 0, 1, 2}. |
static bool geos::geom::IntersectionMatrix::matches | ( | int | actualDimensionValue, | |
char | requiredDimensionSymbol | |||
) | [static] |
Tests if given dimension value satisfies the dimension symbol.
actualDimensionValue | - valid dimension value stored in the IntersectionMatrix. Possible values are {TRUE, FALSE, DONTCARE, 0, 1, 2}. | |
requiredDimensionSymbol | - a character used in the string representation of an IntersectionMatrix. Possible values are {T, F, * , 0, 1, 2}. |
static bool geos::geom::IntersectionMatrix::matches | ( | const std::string & | actualDimensionSymbols, | |
const std::string & | requiredDimensionSymbols | |||
) | [static] |
Returns true if each of the actual dimension symbols satisfies the corresponding required dimension symbol.
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}. |
void geos::geom::IntersectionMatrix::add | ( | IntersectionMatrix * | other | ) |
Adds one matrix to another.
Addition is defined by taking the maximum dimension value of each position in the summand matrices.
other | - the matrix to add. |
void geos::geom::IntersectionMatrix::set | ( | int | row, | |
int | column, | |||
int | dimensionValue | |||
) |
Changes the value of one of this IntersectionMatrixs elements.
row | - the row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry. | |
column | - the column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry. | |
dimensionValue | - the new value of the element. |
void geos::geom::IntersectionMatrix::set | ( | const std::string & | dimensionSymbols | ) |
Changes the elements of this IntersectionMatrix to the dimension symbols in dimensionSymbols.
dimensionSymbols | - nine dimension symbols to which to set this IntersectionMatrix elements. Possible values are {T, F, * , 0, 1, 2}. |
void geos::geom::IntersectionMatrix::setAtLeast | ( | int | row, | |
int | column, | |||
int | minimumDimensionValue | |||
) |
Changes the specified element to minimumDimensionValue if the element is less.
row | - the row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry. | |
column | - the column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry. | |
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}. |
void geos::geom::IntersectionMatrix::setAtLeastIfValid | ( | int | row, | |
int | column, | |||
int | 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.
row | - the row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry. | |
column | - the column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry. | |
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}. |
void geos::geom::IntersectionMatrix::setAtLeast | ( | std::string | minimumDimensionSymbols | ) |
For each element in this IntersectionMatrix, changes the element to the corresponding minimum dimension symbol if the element is less.
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} . |
void geos::geom::IntersectionMatrix::setAll | ( | int | dimensionValue | ) |
Changes the elements of this IntersectionMatrix to dimensionValue.
dimensionValue | - the dimension value to which to set this IntersectionMatrix elements. Possible values {TRUE, FALSE, DONTCARE, 0, 1, 2}. |
int geos::geom::IntersectionMatrix::get | ( | int | row, | |
int | column | |||
) | const |
Returns the value of one of this IntersectionMatrixs elements.
row | - the row of this IntersectionMatrix, indicating the interior, boundary or exterior of the first Geometry. | |
column | - the column of this IntersectionMatrix, indicating the interior, boundary or exterior of the second Geometry. |
bool geos::geom::IntersectionMatrix::isDisjoint | ( | ) | const |
Returns true if this IntersectionMatrix is FF*FF****.
bool geos::geom::IntersectionMatrix::isIntersects | ( | ) | const |
Returns true if isDisjoint returns false.
bool geos::geom::IntersectionMatrix::isTouches | ( | int | dimensionOfGeometryA, | |
int | dimensionOfGeometryB | |||
) | const |
Returns true if this IntersectionMatrix is FT*******, F**T***** or F***T****.
dimensionOfGeometryA | - the dimension of the first Geometry. | |
dimensionOfGeometryB | - the dimension of the second Geometry. |
bool geos::geom::IntersectionMatrix::isCrosses | ( | int | dimensionOfGeometryA, | |
int | dimensionOfGeometryB | |||
) | const |
Returns true if this IntersectionMatrix is:
dimensionOfGeometryA | - he dimension of the first Geometry. | |
dimensionOfGeometryB | - the dimension of the second Geometry. |
bool geos::geom::IntersectionMatrix::isWithin | ( | ) | const |
Returns true if this IntersectionMatrix is T*F**F***.
bool geos::geom::IntersectionMatrix::isContains | ( | ) | const |
Returns true if this IntersectionMatrix is T*****FF*.
bool geos::geom::IntersectionMatrix::isEquals | ( | int | dimensionOfGeometryA, | |
int | dimensionOfGeometryB | |||
) | const |
Returns true if this IntersectionMatrix is T*F**FFF*.
dimensionOfGeometryA | - he dimension of the first Geometry. | |
dimensionOfGeometryB | - the dimension of the second Geometry. |
bool geos::geom::IntersectionMatrix::isOverlaps | ( | int | dimensionOfGeometryA, | |
int | dimensionOfGeometryB | |||
) | const |
Returns true if this IntersectionMatrix is:
dimensionOfGeometryA | - he dimension of the first Geometry. | |
dimensionOfGeometryB | - the dimension of the second Geometry. |
bool geos::geom::IntersectionMatrix::isCovers | ( | ) | const |
Returns true if this IntersectionMatrix is T*****FF*
or *T****FF*
or ***T**FF*
or ****T*FF*
.
true
if the first Geometry covers the second bool geos::geom::IntersectionMatrix::isCoveredBy | ( | ) | const |
Returns true if this IntersectionMatrix is T*F**F***
*TF**F***
or **FT*F***
or **F*TF***
.
true
if the first Geometry is covered by the second IntersectionMatrix* geos::geom::IntersectionMatrix::transpose | ( | ) |
Transposes this IntersectionMatrix.
std::string geos::geom::IntersectionMatrix::toString | ( | ) | const |
Returns a nine-character String representation of this IntersectionMatrix.