![]() |
FMT 1.2.0
Forest management tools for forest planning
|
Spatially referenced coordinate holding an x and y position on a raster grid. More...
#include <FMTCoordinate.h>
Public Member Functions | |
| FMTCoordinate () | |
| Default constructor for FMTCoordinate. | |
| ~FMTCoordinate ()=default | |
| Default destructor for FMTCoordinate. | |
| FMTCoordinate (uint16_t p_x, uint16_t p_y) | |
| Construct a FMTCoordinate from an x and y position. | |
| FMTCoordinate (const FMTCoordinate &rhs) | |
| Copy constructor for FMTCoordinate. | |
| FMTCoordinate | at (unsigned int id) const |
| Return the coordinate at a given index. | |
| double | distance (const FMTCoordinate &coord) const |
| Return the distance to another coordinate. | |
| template<typename T > | |
| bool | within (const T &ldistance, const FMTCoordinate &coord) const |
| Return true if another coordinate is within a given distance. | |
| void | upEnveloppe (std::array< FMTCoordinate, 4 > &enveloppe) const |
| Update the bounding envelope with this coordinate. | |
| size_t | hash () const |
| Return the hash of the coordinate. | |
| FMTCoordinate & | operator= (const FMTCoordinate &rhs) |
| Copy assignment operator for FMTCoordinate. | |
| const std::vector< double > | getSpatialCoordinate (std::vector< double > geoTransform) const |
| Return the spatial coordinate using a geographic transform. | |
| bool | operator== (const FMTCoordinate &rhs) const |
| Equality comparison operator of FMTCoordinate. | |
| bool | operator< (const FMTCoordinate &rhs) const |
| Less than comparison operator of FMTCoordinate. | |
| std::set< FMTCoordinate >::const_iterator | closest (const std::vector< std::set< FMTCoordinate >::const_iterator > &coordinates, double &approximation) const |
| Return the closest coordinate among the given coordinates. | |
| operator std::string () const | |
| Convert the coordinate to its string representation. | |
| std::set< FMTCoordinate > | getNeighbors (const uint16_t &nsize, const bool &circle=false) const |
| Return the neighboring coordinates within a given size. | |
| uint16_t | getX () const |
| Return the x position of the coordinate. | |
| uint16_t | getY () const |
| Return the y position of the coordinate. | |
Static Public Member Functions | |
| static FMTCoordinate | getAverageCentroid (const std::array< FMTCoordinate, 4 > &p_enveloppe) |
| Return the average centroid of an envelope. | |
| static std::set< FMTCoordinate > | getTerritory (const std::array< FMTCoordinate, 4 > &p_enveloppe, const size_t &p_distance) |
| Return the coordinates of a territory within a distance of an envelope. | |
| static size_t | getHeight (const std::array< FMTCoordinate, 4 > &p_enveloppe) |
| Return the height of an envelope. | |
| static size_t | getWidth (const std::array< FMTCoordinate, 4 > &p_enveloppe) |
| Return the width of an envelope. | |
Friends | |
| class | boost::serialization::access |
Spatially referenced coordinate holding an x and y position on a raster grid.
| Spatial::FMTCoordinate::FMTCoordinate | ( | ) |
Default constructor for FMTCoordinate.
|
default |
Default destructor for FMTCoordinate.
| Spatial::FMTCoordinate::FMTCoordinate | ( | uint16_t | p_x, |
| uint16_t | p_y | ||
| ) |
Construct a FMTCoordinate from an x and y position.
| [in] | p_x | the x position. |
| [in] | p_y | the y position. |
| Spatial::FMTCoordinate::FMTCoordinate | ( | const FMTCoordinate & | rhs | ) |
Copy constructor for FMTCoordinate.
| [in] | rhs | the FMTCoordinate to copy. |
| FMTCoordinate Spatial::FMTCoordinate::at | ( | unsigned int | id | ) | const |
Return the coordinate at a given index.
| [in] | id | the index. |
| std::set< FMTCoordinate >::const_iterator Spatial::FMTCoordinate::closest | ( | const std::vector< std::set< FMTCoordinate >::const_iterator > & | coordinates, |
| double & | approximation | ||
| ) | const |
Return the closest coordinate among the given coordinates.
| [in] | coordinates | the coordinates to search. |
| [out] | approximation | the approximated distance to the closest coordinate. |
| double Spatial::FMTCoordinate::distance | ( | const FMTCoordinate & | coord | ) | const |
Return the distance to another coordinate.
| [in] | coord | the other coordinate. |
|
static |
Return the average centroid of an envelope.
| [in] | p_enveloppe | the envelope. |
|
static |
Return the height of an envelope.
| [in] | p_enveloppe | the envelope. |
| std::set< FMTCoordinate > Spatial::FMTCoordinate::getNeighbors | ( | const uint16_t & | nsize, |
| const bool & | circle = false |
||
| ) | const |
Return the neighboring coordinates within a given size.
| [in] | nsize | the neighborhood size. |
| [in] | circle | if true uses a circular neighborhood. |
| const std::vector< double > Spatial::FMTCoordinate::getSpatialCoordinate | ( | std::vector< double > | geoTransform | ) | const |
Return the spatial coordinate using a geographic transform.
| [in] | geoTransform | the geographic transform. |
|
static |
Return the coordinates of a territory within a distance of an envelope.
| [in] | p_enveloppe | the envelope. |
| [in] | p_distance | the distance. |
|
static |
Return the width of an envelope.
| [in] | p_enveloppe | the envelope. |
| uint16_t Spatial::FMTCoordinate::getX | ( | ) | const |
Return the x position of the coordinate.
| uint16_t Spatial::FMTCoordinate::getY | ( | ) | const |
Return the y position of the coordinate.
| size_t Spatial::FMTCoordinate::hash | ( | ) | const |
Return the hash of the coordinate.
| Spatial::FMTCoordinate::operator std::string | ( | ) | const |
Convert the coordinate to its string representation.
| bool Spatial::FMTCoordinate::operator< | ( | const FMTCoordinate & | rhs | ) | const |
Less than comparison operator of FMTCoordinate.
| [in] | rhs | the FMTCoordinate to compare with. |
| FMTCoordinate & Spatial::FMTCoordinate::operator= | ( | const FMTCoordinate & | rhs | ) |
Copy assignment operator for FMTCoordinate.
| [in] | rhs | the FMTCoordinate to copy. |
| bool Spatial::FMTCoordinate::operator== | ( | const FMTCoordinate & | rhs | ) | const |
Equality comparison operator of FMTCoordinate.
| [in] | rhs | the FMTCoordinate to compare with. |
| void Spatial::FMTCoordinate::upEnveloppe | ( | std::array< FMTCoordinate, 4 > & | enveloppe | ) | const |
Update the bounding envelope with this coordinate.
| [in,out] | enveloppe | the envelope to update. |
| bool Spatial::FMTCoordinate::within | ( | const T & | ldistance, |
| const FMTCoordinate & | coord | ||
| ) | const |
Return true if another coordinate is within a given distance.
| T | the distance type. |
| [in] | ldistance | the distance threshold. |
| [in] | coord | the other coordinate. |
|
friend |