GEOS
3.14.0dev
|
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix. More...
#include <IntersectionMatrix.h>
Public Member Functions | |
IntersectionMatrix () | |
Default constructor. More... | |
IntersectionMatrix (const std::string &elements) | |
Overridden constructor. More... | |
IntersectionMatrix (const IntersectionMatrix &other) | |
Copy constructor. More... | |
bool | matches (const std::string &requiredDimensionSymbols) const |
Returns whether the elements of this IntersectionMatrix satisfies the required dimension symbols. More... | |
void | add (IntersectionMatrix *other) |
Adds one matrix to another. More... | |
void | set (Location row, Location column, int dimensionValue) |
Changes the value of one of this IntersectionMatrixs elements. More... | |
void | set (const std::string &dimensionSymbols) |
Changes the elements of this IntersectionMatrix to the dimension symbols in dimensionSymbols. More... | |
void | setAtLeast (Location row, Location column, int minimumDimensionValue) |
Changes the specified element to minimumDimensionValue if the element is less. More... | |
void | setAtLeastIfValid (Location row, Location 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. More... | |
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. More... | |
void | setAll (int dimensionValue) |
Changes the elements of this IntersectionMatrix to dimensionValue. More... | |
int | get (Location row, Location column) const |
Returns the value of one of this IntersectionMatrixs elements. More... | |
bool | isDisjoint () const |
Returns true if this IntersectionMatrix is FF*FF****. More... | |
bool | isIntersects () const |
Returns true if isDisjoint returns false. More... | |
bool | isTouches (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is FT*******, F**T***** or F***T****. More... | |
bool | isCrosses (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is: More... | |
bool | isWithin () const |
Returns true if this IntersectionMatrix is T*F**F***. More... | |
bool | isContains () const |
Returns true if this IntersectionMatrix is T*****FF*. More... | |
bool | isEquals (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is T*F**FFF*. More... | |
bool | isOverlaps (int dimensionOfGeometryA, int dimensionOfGeometryB) const |
Returns true if this IntersectionMatrix is: More... | |
bool | isCovers () const |
Returns true if this IntersectionMatrix is T*****FF* or T****FF or ***T**FF* or ****T*FF* More... | |
bool | isCoveredBy () const |
Returns true if this IntersectionMatrix is T*F**F*** *TF**F*** or **FT*F*** or **F*TF*** More... | |
IntersectionMatrix * | transpose () |
Transposes this IntersectionMatrix. More... | |
std::string | toString () const |
Returns a nine-character String representation of this IntersectionMatrix. More... | |
Static Public Member Functions | |
static bool | matches (int actualDimensionValue, char requiredDimensionSymbol) |
Tests if given dimension value satisfies the dimension symbol. More... | |
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. More... | |
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
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 | ) |
Overridden 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.
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. |
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::isContains | ( | ) | const |
Returns true if this IntersectionMatrix is T*****FF*.
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 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::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. |
For this function to return true, the Geometrys must be a point and a curve; a point and a surface; two curves; or a curve and a surface.
bool geos::geom::IntersectionMatrix::isDisjoint | ( | ) | const |
Returns true if this IntersectionMatrix is FF*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::isIntersects | ( | ) | const |
Returns true if isDisjoint returns false.
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. |
For this function to return true, the Geometrys must be two points, two curves or two surfaces.
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::isWithin | ( | ) | const |
Returns true if this IntersectionMatrix is T*F**F***.
|
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}. |
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 |
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}. |
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}. |
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::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}. |
void geos::geom::IntersectionMatrix::setAtLeast | ( | Location | row, |
Location | 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::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::setAtLeastIfValid | ( | Location | row, |
Location | 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}. |
std::string geos::geom::IntersectionMatrix::toString | ( | ) | const |
Returns a nine-character String representation of this IntersectionMatrix.
IntersectionMatrix* geos::geom::IntersectionMatrix::transpose | ( | ) |
Transposes this IntersectionMatrix.
It returns 'this' pointer so why not to return const-pointer?
May be it would be better to return copy of transposed matrix?