![]() |
OGS
|
Class Raster is used for managing raster data.
A raster consists of the meta data like number of columns and rows, the lower left point, the size of a raster pixel and a value for invalid data pixels. Additional the object needs the raster data itself. The raster data will be copied from the constructor. The destructor will release the memory.
#include <Raster.h>
Public Types | |
using | const_iterator = const double * |
using | iterator = double * |
Public Member Functions | |
template<typename InputIterator > | |
Raster (RasterHeader header, InputIterator begin, InputIterator end) | |
Constructor for an object of class Raster. The raster data have to be handed over via input iterators. Deploying iterators has the advantage that the use of the class is independent from the input container. More... | |
Raster (Raster const &)=delete | |
Raster (Raster &&)=delete | |
Raster & | operator= (Raster const &)=delete |
Raster & | operator= (Raster &&)=delete |
RasterHeader const & | getHeader () const |
Returns the complete header information. More... | |
void | refineRaster (std::size_t scaling) |
const_iterator | begin () const |
const_iterator | end () const |
double | getValueAtPoint (const MathLib::Point3d &pnt) const |
double | interpolateValueAtPoint (const MathLib::Point3d &pnt) const |
Interpolates the elevation of the given point based on the 8-neighbourhood of the raster cell it is located on. More... | |
bool | isPntOnRaster (MathLib::Point3d const &pnt) const |
Checks if the given point is located within the (x,y)-extension of the raster. More... | |
~Raster () | |
Private Member Functions | |
void | setCellSize (double cell_size) |
void | setNoDataVal (double no_data_val) |
Private Attributes | |
GeoLib::RasterHeader | _header |
double * | _raster_data |
using GeoLib::Raster::const_iterator = const double* |
using GeoLib::Raster::iterator = double* |
|
inline |
Constructor for an object of class Raster. The raster data have to be handed over via input iterators. Deploying iterators has the advantage that the use of the class is independent from the input container.
header | meta-information about the raster (height, width, etc.) |
begin | input iterator pointing to the first element of the data |
end | input iterator pointing to the last element of the data, end have to be reachable from begin |
Definition at line 57 of file Raster.h.
References _raster_data, begin(), MathLib::LinAlg::copy(), and end().
|
delete |
|
delete |
GeoLib::Raster::~Raster | ( | ) |
Definition at line 58 of file Raster.cpp.
References _raster_data.
|
inline |
Constant iterator that is pointing to the first raster pixel value.
Definition at line 81 of file Raster.h.
References _raster_data.
Referenced by Raster(), LayeredMeshGenerator::calcEpsilon(), MeshLib::RasterToMesh::convert(), and FileIO::AsciiRasterInterface::writeRasterAsASC().
|
inline |
Constant iterator that is pointing to the last raster pixel value.
Definition at line 86 of file Raster.h.
References _header, _raster_data, GeoLib::RasterHeader::n_cols, and GeoLib::RasterHeader::n_rows.
Referenced by Raster(), and LayeredMeshGenerator::calcEpsilon().
|
inline |
Returns the complete header information.
Definition at line 70 of file Raster.h.
References _header.
Referenced by MeshLib::RasterToMesh::convert(), DirectConditionGenerator::directToSurfaceNodes(), LayeredMeshGenerator::getNewLayerNode(), MeshLib::MeshLayerMapper::layerMapping(), MeshLib::RasterDataToMesh::projectToElements(), MeshLib::RasterDataToMesh::projectToNodes(), and FileIO::AsciiRasterInterface::writeRasterAsASC().
double GeoLib::Raster::getValueAtPoint | ( | const MathLib::Point3d & | pnt | ) | const |
Returns the raster value at the position of the given point.
Definition at line 63 of file Raster.cpp.
References _header, _raster_data, GeoLib::RasterHeader::cell_size, GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_rows, GeoLib::RasterHeader::no_data, and GeoLib::RasterHeader::origin.
Referenced by DirectConditionGenerator::directToSurfaceNodes(), and MeshLib::MeshLayerMapper::layerMapping().
double GeoLib::Raster::interpolateValueAtPoint | ( | const MathLib::Point3d & | pnt | ) | const |
Interpolates the elevation of the given point based on the 8-neighbourhood of the raster cell it is located on.
Definition at line 92 of file Raster.cpp.
References _header, _raster_data, GeoLib::RasterHeader::cell_size, GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_rows, GeoLib::RasterHeader::no_data, and GeoLib::RasterHeader::origin.
Referenced by VtkImageDataToSurfacePointsFilter::createPointSurface(), LayeredMeshGenerator::getNewLayerNode(), and MeshLib::MeshLayerMapper::layerMapping().
bool GeoLib::Raster::isPntOnRaster | ( | MathLib::Point3d const & | pnt | ) | const |
Checks if the given point is located within the (x,y)-extension of the raster.
Definition at line 158 of file Raster.cpp.
References _header, GeoLib::RasterHeader::cell_size, GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_rows, and GeoLib::RasterHeader::origin.
Referenced by MeshLib::MeshLayerMapper::layerMapping().
void GeoLib::Raster::refineRaster | ( | std::size_t | scaling | ) |
Refine the raster using scaling as a refinement parameter.
Definition at line 25 of file Raster.cpp.
References _header, _raster_data, GeoLib::RasterHeader::cell_size, GeoLib::RasterHeader::n_cols, and GeoLib::RasterHeader::n_rows.
|
private |
|
private |
|
private |
Definition at line 105 of file Raster.h.
Referenced by end(), getHeader(), getValueAtPoint(), interpolateValueAtPoint(), isPntOnRaster(), and refineRaster().
|
private |
Definition at line 106 of file Raster.h.
Referenced by Raster(), ~Raster(), begin(), end(), getValueAtPoint(), interpolateValueAtPoint(), and refineRaster().