27 #include "../core/translator/Translator.h" 28 #include "../raster/BandProperty.h" 29 #include "../datatype/Enums.h" 38 #include <boost/format.hpp> 52 int err = grib_get_size(
m_handle,
"values", &size);
119 assert(x == 0 && y == 0);
126 assert(x == 0 && y == 0);
133 assert(x == 0 && y == 0);
147 int err = grib_get_long(
m_handle, key, &val);
159 int err = grib_get_double(
m_handle, key, &val);
171 std::size_t length = 0;
173 int err = grib_get_string(
m_handle, key, val, &length);
178 return std::string(val);
183 const char* errmsg = grib_get_error_message(errCode);
187 return std::string(errmsg);
te::rst::Raster * getRaster() const
Returns the associated raster.
void read(int x, int y, void *buffer) const
It reads a data block to the specified buffer.
A raster band description.
Base exception class for plugin module.
int m_nblocksx
The number of blocks in x.
int m_nblocksy
The number of blocks in y.
grib_handle * m_handle
The grib handle.
double m_noDataValue
Value to indicate elements where there is no data, default is std::numeric_limits<double>::max().
void setIValue(unsigned int c, unsigned int r, const double value)
Sets the imaginary attribute value in a complex band of a cell.
void getValue(unsigned int c, unsigned int r, double &value) const
Returns the cell attribute value.
An abstract class for raster data strucutures.
int m_blkw
Block width (pixels).
std::string getString(const char *key) const
~Band()
Virtual destructor.
long getLong(const char *key) const
double * m_data
The matrix data.
Band(Raster *r, std::size_t idx, grib_handle *handle)
Band implemntatin for GRIB.
Band & operator=(const Band &rhs)
A raster class for GRIB format.
static std::string getErrMsg(int errCode)
void setValue(unsigned int c, unsigned int r, const double value)
Sets the cell attribute value.
grib_handle * getHandle() const
int m_blkh
Block height (pixels).
void write(int x, int y, void *buffer)
It writes a data block from the specified buffer.
Raster * m_raster
The associated raster.
virtual int getBlockSize() const
It returns the number of bytes ocuppied by a data block.
double getDouble(const char *key) const
BandProperty * m_property
The band information.
#define TR_GRIB(message)
It marks a string in order to get translated. This is a special mark used in the DataAccess module of...
void getIValue(unsigned int c, unsigned int r, double &value) const
Returns the imaginary attribute value in a complex band of a cell.