openModeller  Version 1.5.0
TerralibRaster Class Reference

Suport for a TerraLib Raster. More...

#include <TerralibRaster.hh>

Inheritance diagram for TerralibRaster:
Inheritance graph
Collaboration diagram for TerralibRaster:
Collaboration graph

Public Member Functions

 TerralibRaster ()
 Empty Constructor. More...
 
void createRaster (const std::string &str, int categ=0)
 Open an existing raster file or a raster in a TerraLib database (read only). More...
 
void createRaster (const std::string &str, const MapFormat &format)
 Create a new file for projections. More...
 
 ~TerralibRaster ()
 
int get (Coord x, Coord y, Scalar *val)
 Fills '*val' with the map value at (x,y). More...
 
int put (Coord x, Coord y, Scalar val)
 Put '*val' at the (x,y) coordinate. More...
 
int put (Coord x, Coord y)
 Put 'no data val' at the (x,y) coordinate. More...
 
int getMinMax (Scalar *min, Scalar *max)
 
int deleteRaster ()
 
- Public Member Functions inherited from Raster
virtual ~Raster ()
 
Headerheader ()
 
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
 
bool hasMinMax ()
 
void setMinMax (Scalar min, Scalar max)
 
virtual void finish ()
 
virtual bool hasCustomGeotransform ()
 
virtual int getExtentInStandardCs (Coord *xmin, Coord *ymin, Coord *xmax, Coord *ymax)
 

Static Public Member Functions

static RasterCreateRasterCallback ()
 Return a new instance of TerralibRaster. More...
 

Private Member Functions

void openTeRaster ()
 Open an existing TeRaster in a database or file disk. More...
 
void createTeRaster ()
 Create a new TeRaster in a database or file disk. More...
 

Private Attributes

TeDatabase * db_
 Pointer to database connection. More...
 
TeRaster * raster_
 
TeRasterParams * params_
 
TeLayer * layer_
 
TeStringParserte_str_parser_
 TerraLib DataBase string parser. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Raster
 Raster ()
 
- Protected Attributes inherited from Raster
Scalar f_scalefactor
 
std::string f_file
 
Header f_hdr
 

Detailed Description

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.

Constructor & Destructor Documentation

TerralibRaster::TerralibRaster ( )
inline

Empty Constructor.

RasterFactory need a empty constructor.

Definition at line 64 of file TerralibRaster.hh.

Referenced by CreateRasterCallback().

TerralibRaster::~TerralibRaster ( )

Destructor

Definition at line 239 of file TerralibRaster.cpp.

References layer_, raster_, and te_str_parser_.

Member Function Documentation

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).

Parameters
strTerraLib string pointing to the raster.
categif != 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.

Parameters
strTerraLib string pointing to the raster.
formatIt is the output format specification.

Needed by RasterFactory.

Create a new file for projections.

Parameters
fileis the name of the output file
formatis 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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

int TerralibRaster::deleteRaster ( )
virtual

Deletes the associated raster.

Returns
1 if the raster was successfully deleted, 0 otherwise

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_.

Here is the call graph for this function:

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.

Here is the call graph for this function:

int TerralibRaster::getMinMax ( Scalar min,
Scalar max 
)
virtual

Finds the minimum and maximum values in the first band.

Parameters
minPointer to minimum value
maxPointer to maximum value
Returns
1 if values are present, 0 otherwise

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_.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Member Data Documentation

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
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().


The documentation for this class was generated from the following files: