template<typename Key = std::string, typename Time = int>
class quetzal::geography::landscape< Key, Time >
Discrete spatio-temporal variations of a set of environmental variables.
Read and write multiple geo-referenced raster datasets with multiple bands (layers). Multiple quetzal::geography::raster objects are assembled into a multivariate discrete quetzal::geography::landscape. This geo-spatial collection is constructed from raster files and gives strong guarantees on grids consistency.
- Template Parameters
-
Key | A key used to uniquely identify a variable, e.g. std::string. |
Time | Type used as time period for every band, e.g. std::string with 4.2-0.3 ka |
|
|
auto | num_variables () const noexcept |
| Retrieves the number of variables (rasters)
|
|
auto | num_locations () const noexcept |
| Number of cells in the raster.
|
|
|
const raster< time_type > & | operator[] (const key_type &key) const |
| Returns a const reference to the mapped raster with key equivalent to key . If no such raster exists, an exception of type std::out_of_range is thrown.
|
|
raster< time_type > & | operator[] (const key_type &key) |
| Returns a reference to the mapped raster with key equivalent to key . If no such raster exists, an exception of type std::out_of_range is thrown.
|
|
|
latlon | origin () const noexcept |
| Origin of the spatial grid.
|
|
resolution< decimal_degree > | get_resolution () const noexcept |
| Resolution of the spatial grid.
|
|
extent< decimal_degree > | get_extent () const noexcept |
| Extent of the spatial grid.
|
|
int | width () const noexcept |
| Width of the spatial grid.
|
|
int | height () const noexcept |
| Height of the spatial grid.
|
|
int | depth () const noexcept |
| Depth of the spatial grid.
|
|
|
auto | locations () const noexcept |
| Location descriptors (unique identifiers) of the grid cells.
|
|
auto | times () const noexcept |
| Time descriptors (unique identifiers) of the dataset bands.
|
|
bool | is_valid (location_descriptor x) const noexcept |
| Check if a descriptor describes a valid location of the spatial grid.
|
|
bool | is_valid (const colrow &x) const noexcept |
| Check if the coordinate describes a valid location of the spatial grid.
|
|
bool | is_valid (const rowcol &x) const noexcept |
| Check if the coordinate describes a valid location of the spatial grid.
|
|
bool | contains (const latlon &x) const noexcept |
| Check if the raster contains a coordinate.
|
|
bool | contains (const lonlat &x) const noexcept |
| Check if the raster contains a coordinate.
|
|
bool | is_valid (time_descriptor t) const noexcept |
| Check if the time descriptor is a valid index.
|
|
bool | is_recorded (const time_type &t) const noexcept |
| Search for the exact time in the list of time points recorded by the raster.
|
|
bool | is_in_interval (const time_type &t) const noexcept |
| Check if the exact time point falls between the first and last date of record.
|
|
|
location_descriptor | to_descriptor (const colrow &x) const noexcept |
| Location descriptor of the cell identified by its column/row.
|
|
location_descriptor | to_descriptor (const latlon &x) const noexcept |
| Location descriptor of the cell to which the given coordinate belongs.
|
|
colrow | to_colrow (const latlon &x) const noexcept |
| Column and row of the cell to which the given coordinate belongs.
|
|
rowcol | to_rowcol (const latlon &x) const noexcept |
| Row and column of the cell to which the given coordinate belongs.
|
|
colrow | to_colrow (location_descriptor x) const noexcept |
| Column and row of the cell to which the given descriptor belongs.
|
|
latlon | to_latlon (location_descriptor x) const noexcept |
| Latitude and longitude of the cell to which the given coordinate belongs.
|
|
lonlat | to_lonlat (location_descriptor x) const noexcept |
| Longitude and latitude of the cell to which the given coordinate belongs.
|
|
latlon | to_latlon (const colrow &x) const noexcept |
| Latitude and longitude of the cell identified by its column/row.
|
|
lonlat | to_lonlat (const colrow &x) const noexcept |
| Longitude and latitude of the deme identified by its column/row.
|
|
latlon | to_centroid (const latlon &x) const |
| Reprojects a coordinate to the centroid of the cell it belongs.
|
|
|
static landscape | from_file (const std::map< key_type, std::filesystem::path > &files, const std::vector< time_type > ×) |
| Read the rasters from a set of input geotiff files.
|
|
template<typename Callable >
requires std::invocable<Callable, location_descriptor, time_descriptor, std::optional<double>> |
void | to_geotiff (Callable f, time_descriptor start, time_descriptor end, const std::filesystem::path &file) const |
| Export a spatio-temporal raster to a Geotiff file.
|
|
void | to_shapefile (std::vector< latlon > points, const std::filesystem::path &file) const |
| Export spatial points to a shapefile.
|
|
void | to_shapefile (std::map< latlon, int > counts, const std::filesystem::path &file) const |
| Export geolocalized counts as spatial-points to a shapefile.
|
|
std::ostream & | write (std::ostream &stream) const |
| Landscape is streamable.
|
|