openModeller
Version 1.4.0
|
Suport for a TerraLib Raster. More...
#include <TerralibRaster.hh>
Public Member Functions | |
TerralibRaster () | |
Empty Constructor. | |
void | createRaster (const std::string &str, int categ=0) |
Open an existing raster file or a raster in a TerraLib database (read only). | |
void | createRaster (const std::string &str, const MapFormat &format) |
Create a new file for projections. | |
~TerralibRaster () | |
int | get (Coord x, Coord y, Scalar *val) |
Fills '*val' with the map value at (x,y). | |
int | put (Coord x, Coord y, Scalar val) |
Put '*val' at the (x,y) coordinate. | |
int | put (Coord x, Coord y) |
Put 'no data val' at the (x,y) coordinate. | |
int | getMinMax (Scalar *min, Scalar *max) |
int | deleteRaster () |
Static Public Member Functions | |
static Raster * | CreateRasterCallback () |
Return a new instance of TerralibRaster. | |
Private Member Functions | |
void | openTeRaster () |
Open an existing TeRaster in a database or file disk. | |
void | createTeRaster () |
Create a new TeRaster in a database or file disk. | |
Private Attributes | |
TeDatabase * | db_ |
Pointer to database connection. | |
TeRaster * | raster_ |
TeRasterParams * | params_ |
TeLayer * | layer_ |
TeStringParser * | te_str_parser_ |
TerraLib DataBase string parser. |
Suport for a TerraLib Raster.
Manages raster files with TerraLib http://www.dpi.inpe.br/terralib/index.php .
Definition at line 51 of file TerralibRaster.hh.
TerralibRaster::TerralibRaster | ( | ) | [inline] |
Empty Constructor.
RasterFactory need a empty constructor.
Definition at line 64 of file TerralibRaster.hh.
Referenced by CreateRasterCallback().
Destructor
Definition at line 239 of file TerralibRaster.cpp.
References layer_, raster_, and te_str_parser_.
void TerralibRaster::createRaster | ( | const std::string & | str, |
int | categ = 0 |
||
) | [virtual] |
Open an existing raster file or a raster in a TerraLib database (read only).
str | TerraLib string pointing to the raster. |
categ | if != 0 this is a categorical map (ie it can't be interpolated). Othewise this is a continuos map. |
Needed by RasterFactory..
Implements Raster.
void TerralibRaster::createRaster | ( | const std::string & | str, |
const MapFormat & | format | ||
) | [virtual] |
Create a new file for projections.
str | TerraLib string pointing to the raster. |
format | It is the output format specification. |
Needed by RasterFactory.
Create a new file for projections.
file | is the name of the output file |
format | is the output format specification. |
Implements Raster.
Definition at line 156 of file TerralibRaster.cpp.
References createTeRaster(), Log::error(), Raster::f_hdr, Raster::f_scalefactor, MapFormat::FloatingTiff, MapFormat::getFormat(), MapFormat::getHeight(), MapFormat::getProjection(), MapFormat::getWidth(), MapFormat::getXMax(), MapFormat::getXMin(), MapFormat::getYMax(), MapFormat::getYMin(), MapFormat::GreyBMP, MapFormat::GreyTiff, Log::instance(), params_, raster_, Header::setProj(), TeStringParser::str_, te_str_parser_, and Log::warn().
Raster * TerralibRaster::CreateRasterCallback | ( | ) | [static] |
Return a new instance of TerralibRaster.
RasterFactory calls this function to build a new Raster.
Needed by RasterFactory.
Definition at line 61 of file TerralibRaster.cpp.
References TerralibRaster().
Referenced by RasterFactory::instance().
void TerralibRaster::createTeRaster | ( | ) | [private] |
Create a new TeRaster in a database or file disk.
Definition at line 353 of file TerralibRaster.cpp.
References TeDatabaseManager::create(), db_, Log::error(), Raster::f_hdr, Log::instance(), TeDatabaseManager::instance(), layer_, TeStringParser::layerName_, TeStringParser::parse(), Header::proj, raster_, TeStringParser::str_, and te_str_parser_.
Referenced by createRaster().
int TerralibRaster::deleteRaster | ( | ) | [virtual] |
Deletes the associated raster.
Implements Raster.
Definition at line 412 of file TerralibRaster.cpp.
References TeDatabaseManager::create(), db_, Log::error(), Log::instance(), TeDatabaseManager::instance(), layer_, params_, raster_, and te_str_parser_.
int TerralibRaster::get | ( | Coord | px, |
Coord | py, | ||
Scalar * | val | ||
) | [virtual] |
Fills '*val' with the map value at (x,y).
Returns zero if (x,y) is out of range.
Fills '*val' with the map value at (x,y). Returns zero if (x,y) is out of range.
Implements Raster.
Definition at line 254 of file TerralibRaster.cpp.
References Header::convertLonLat2XY(), Raster::f_hdr, raster_, Header::xdim, and Header::ydim.
int TerralibRaster::getMinMax | ( | Scalar * | min, |
Scalar * | max | ||
) | [virtual] |
Finds the minimum and maximum values in the first band.
min | Pointer to minimum value |
max | Pointer to maximum value |
Implements Raster.
Definition at line 399 of file TerralibRaster.cpp.
References Raster::f_hdr.
void TerralibRaster::openTeRaster | ( | ) | [private] |
Open an existing TeRaster in a database or file disk.
Definition at line 319 of file TerralibRaster.cpp.
References TeDatabaseManager::create(), db_, Log::error(), Log::instance(), TeDatabaseManager::instance(), layer_, TeStringParser::layerName_, TeStringParser::parse(), raster_, TeStringParser::str_, and te_str_parser_.
int TerralibRaster::put | ( | Coord | px, |
Coord | py, | ||
Scalar | val | ||
) | [virtual] |
Put '*val' at the (x,y) coordinate.
Returns 0 if (x,y) is out of range or the map is read only. supports only single band output files.
Put '*val' at the (x,y) coordinate. Returns 0 if (x,y) is out of range or the map is read only. supports only single band output files.
Implements Raster.
Definition at line 279 of file TerralibRaster.cpp.
References Header::convertLonLat2XY(), Raster::f_hdr, Raster::f_scalefactor, raster_, Header::xdim, and Header::ydim.
int TerralibRaster::put | ( | Coord | px, |
Coord | py | ||
) | [virtual] |
Put 'no data val' at the (x,y) coordinate.
Returns 0 if (x,y) is out of range or the map is read only. supports only single band output files.
Put 'no data val' at the (x,y) coordinate. Returns 0 if (x,y) is out of range or the map is read only. supports only single band output files.
Implements Raster.
Definition at line 300 of file TerralibRaster.cpp.
References Header::convertLonLat2XY(), Raster::f_hdr, Header::noval, raster_, Header::xdim, and Header::ydim.
TeDatabase* TerralibRaster::db_ [private] |
Pointer to database connection.
TerraLib DataBase Parameters
Definition at line 126 of file TerralibRaster.hh.
Referenced by createTeRaster(), deleteRaster(), and openTeRaster().
TeLayer* TerralibRaster::layer_ [private] |
Definition at line 129 of file TerralibRaster.hh.
Referenced by createTeRaster(), deleteRaster(), openTeRaster(), and ~TerralibRaster().
TeRasterParams* TerralibRaster::params_ [private] |
Definition at line 128 of file TerralibRaster.hh.
Referenced by createRaster(), and deleteRaster().
TeRaster* TerralibRaster::raster_ [private] |
Definition at line 127 of file TerralibRaster.hh.
Referenced by createRaster(), createTeRaster(), deleteRaster(), get(), openTeRaster(), put(), and ~TerralibRaster().
TeStringParser* TerralibRaster::te_str_parser_ [private] |
TerraLib DataBase string parser.
Definition at line 132 of file TerralibRaster.hh.
Referenced by createRaster(), createTeRaster(), deleteRaster(), openTeRaster(), and ~TerralibRaster().