openModeller
Version 1.4.0
|
A common interface to rasters. More...
#include <Raster.hh>
Public Member Functions | |
virtual | ~Raster () |
virtual void | createRaster (const std::string &source, int categ=0)=0 |
virtual void | createRaster (const std::string &source, const MapFormat &format)=0 |
Header & | header () |
int | isCategorical () const |
Coord | xMin () const |
Coord | yMin () const |
Coord | xMax () const |
Coord | yMax () const |
int | dimX () const |
int | dimY () const |
Coord | celX () const |
Coord | celY () const |
Scalar | noVal () const |
int | numBand () const |
virtual int | get (Coord px, Coord py, Scalar *val)=0 |
virtual int | put (Coord px, Coord py, Scalar val)=0 |
virtual int | put (Coord px, Coord py)=0 |
virtual int | getMinMax (Scalar *min, Scalar *max)=0 |
bool | hasMinMax () |
void | setMinMax (Scalar min, Scalar max) |
virtual void | finish () |
virtual int | deleteRaster ()=0 |
virtual bool | hasCustomGeotransform () |
virtual int | getExtentInStandardCs (Coord *xmin, Coord *ymin, Coord *xmax, Coord *ymax) |
Protected Member Functions | |
Raster () | |
Protected Attributes | |
Scalar | f_scalefactor |
std::string | f_file |
Header | f_hdr |
Raster::~Raster | ( | ) | [virtual] |
Definition at line 55 of file Raster.cpp.
Raster::Raster | ( | ) | [inline, protected] |
Coord Raster::celX | ( | ) | const [inline] |
Returns the longitudinal cell dimension.
Definition at line 99 of file Raster.hh.
Referenced by Map::getCell().
Coord Raster::celY | ( | ) | const [inline] |
Returns the latitudinal cell dimension.
Definition at line 102 of file Raster.hh.
Referenced by Map::getCell().
virtual void Raster::createRaster | ( | const std::string & | source, |
int | categ = 0 |
||
) | [pure virtual] |
Method to create a raster representation (needed by RasterFactory).
source | A string pointing to a raster source (file name, URL, etc.) |
categ | Indicates if the raster is categorical or not |
Implemented in RemoteRaster, TerralibRaster, WcsProxyRaster, and GdalRaster.
Referenced by RasterFactory::create().
virtual void Raster::createRaster | ( | const std::string & | source, |
const MapFormat & | format | ||
) | [pure virtual] |
Method to create a raster representation (needed by RasterFactory).
source | A string pointing to a raster source (file name, URL, etc.) |
format | Map format |
Implemented in RemoteRaster, WcsProxyRaster, TerralibRaster, and GdalRaster.
virtual int Raster::deleteRaster | ( | ) | [pure virtual] |
Method to delete a raster.
Implemented in GdalRaster, TerralibRaster, RemoteRaster, and WcsProxyRaster.
Referenced by Map::deleteRaster().
int Raster::dimX | ( | ) | const [inline] |
Returns the longitudinal map dimension.
Definition at line 93 of file Raster.hh.
Referenced by Map::getDim(), and Map::getRowColumn().
int Raster::dimY | ( | ) | const [inline] |
Returns the latitudinal map dimension.
Definition at line 96 of file Raster.hh.
Referenced by Map::getDim(), and Map::getRowColumn().
virtual void Raster::finish | ( | ) | [inline, virtual] |
Event that must be called to indicate when the projection is finished.
Reimplemented in GdalRaster, RemoteRaster, and WcsProxyRaster.
Definition at line 154 of file Raster.hh.
Referenced by Map::finish().
virtual int Raster::get | ( | Coord | px, |
Coord | py, | ||
Scalar * | val | ||
) | [pure virtual] |
Fills '*val' with the map value at (x,y).
px | Longitude |
py | Latitude |
val | Value |
Implemented in GdalRaster, and TerralibRaster.
Referenced by Map::get().
virtual int Raster::getExtentInStandardCs | ( | Coord * | xmin, |
Coord * | ymin, | ||
Coord * | xmax, | ||
Coord * | ymax | ||
) | [inline, virtual] |
Calculates the raster extent in openModeller's standard coordinate system. IMPORTANT: Call this only if hasCustomGeotransform returns true. When interacting with Map objects, use Map.getExtent instead, which encapsulates a call to this method when necessary. For some projections, such as lambert azimuth equal area, getting the raster extent through manual coordinate conversion, as was usually done in the Map.getExtent, can be problematic. This method provides a way for raster implementations to better perform the task of calculating the extent.
xmin | Pointer to minimum X value |
ymin | Pointer to minimum Y value |
xmax | Pointer to maximum X value |
ymax | Pointer to maximum Y value |
Reimplemented in GdalRaster.
Definition at line 180 of file Raster.hh.
Referenced by Map::getExtent().
virtual int Raster::getMinMax | ( | Scalar * | min, |
Scalar * | max | ||
) | [pure virtual] |
Finds the minimum and maximum values in the first band.
min | Pointer to minimum value |
max | Pointer to maximum value |
Implemented in GdalRaster, and TerralibRaster.
Referenced by Map::getMinMax().
virtual bool Raster::hasCustomGeotransform | ( | ) | [inline, virtual] |
Indicates if the raster has a better way to carry out conversions from its own coordinate system to the standard system used by openModeller.
Reimplemented in GdalRaster.
Definition at line 165 of file Raster.hh.
Referenced by Map::getExtent().
bool Raster::hasMinMax | ( | ) | [inline] |
Tells if the min and max have already been computed
Definition at line 143 of file Raster.hh.
Referenced by Map::hasMinMax().
Header& Raster::header | ( | ) | [inline] |
Returns the header.
Definition at line 75 of file Raster.hh.
Referenced by RequestFile::_setProjection(), Map::begin(), Map::getHeader(), Map::Map(), and MapFormat::MapFormat().
int Raster::isCategorical | ( | ) | const [inline] |
Returns not zero if this map is categorical.
Definition at line 78 of file Raster.hh.
Referenced by Map::isCategorical().
Scalar Raster::noVal | ( | ) | const [inline] |
int Raster::numBand | ( | ) | const [inline] |
Returns the number of bands.
Definition at line 108 of file Raster.hh.
Referenced by Map::numBand().
virtual int Raster::put | ( | Coord | px, |
Coord | py, | ||
Scalar | val | ||
) | [pure virtual] |
Put 'val' at the (x,y) coordinate. Supports only single band output files.
px | Longitude |
py | Latitude |
val | Value |
Implemented in GdalRaster, RemoteRaster, TerralibRaster, and WcsProxyRaster.
Referenced by Map::put().
virtual int Raster::put | ( | Coord | px, |
Coord | py | ||
) | [pure virtual] |
Put 'no data val' at the (x,y) coordinate. Supports only single band files.
px | Longitude |
py | Latitude |
Implemented in GdalRaster, RemoteRaster, TerralibRaster, and WcsProxyRaster.
void Raster::setMinMax | ( | Scalar | min, |
Scalar | max | ||
) |
Support external specification of min/max.
min | Minimum value |
max | Maximum value |
Definition at line 61 of file Raster.cpp.
References f_hdr, min(), Header::minmax, Header::vmax, and Header::vmin.
Referenced by Map::setMinMax().
Coord Raster::xMax | ( | ) | const [inline] |
Returns the highest longitude.
Definition at line 87 of file Raster.hh.
Referenced by Map::getExtent(), and Map::getRowColumn().
Coord Raster::xMin | ( | ) | const [inline] |
Returns the lowest longitude.
Definition at line 81 of file Raster.hh.
Referenced by Map::getExtent(), and Map::getRowColumn().
Coord Raster::yMax | ( | ) | const [inline] |
Returns the highest latitude.
Definition at line 90 of file Raster.hh.
Referenced by Map::getExtent(), and Map::getRowColumn().
Coord Raster::yMin | ( | ) | const [inline] |
Returns the lowest latitude.
Definition at line 84 of file Raster.hh.
Referenced by Map::getExtent(), and Map::getRowColumn().
std::string Raster::f_file [protected] |
Definition at line 186 of file Raster.hh.
Referenced by GdalRaster::create(), GdalRaster::deleteRaster(), GdalRaster::finish(), GdalRaster::open(), GdalRaster::write(), and GdalRaster::~GdalRaster().
Header Raster::f_hdr [protected] |
Definition at line 192 of file Raster.hh.
Referenced by GdalRaster::calcMinMax(), GdalRaster::create(), TerralibRaster::createRaster(), TerralibRaster::createTeRaster(), GdalRaster::get(), TerralibRaster::get(), TerralibRaster::getMinMax(), GdalRaster::getMinMax(), GdalRaster::iget(), GdalRaster::initBuffer(), GdalRaster::loadRow(), GdalRaster::open(), TerralibRaster::put(), GdalRaster::put(), GdalRaster::read(), setMinMax(), and GdalRaster::write().
Scalar Raster::f_scalefactor [protected] |
Definition at line 184 of file Raster.hh.
Referenced by TerralibRaster::createRaster(), TerralibRaster::put(), and GdalRaster::put().