| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Member Functions
TeRaster Class Reference

Support for a raster geometry. More...

`#include <TeRaster.h>`

Inheritance diagram for TeRaster:

List of all members.

## Classes

class | iterator
| A raster iterator. More...
class | iteratorPoly
| A raster iterator with a restriction of area. More...

## Public Member Functions

| TeRaster (const string &filename, const char &mode= 'r')
| Constructor from file.
| TeRaster (TeRasterParams &pars)
| Constructor from parameters.
| TeRaster (int ncols, int nlines, int nbands, TeDataType elemType)
| Contructor from commom parameters.
| TeRaster ()
| Empty constructor.
| ~TeRaster ()
| Destructor.
const TeRasterParams & | params () const
| Returns the const parameters of the raster.
TeRasterParams & | params ()
| Returns the parameters of the raster.
int | nBands ()
| Returns the number of lines of the raster.
void | updateParams (TeRasterParams &par)
| Update the parametes of a raster file.
TeGeomRep | elemType ()
| Returns the type of the geometry.
void | setDecoder (TeDecoder *dec)
| Associate a decoder to a raster.
bool | status ()
| Returns status of the raster as a Boolean value.
TeDecoder * | decoder ()
| Returns a pointer to the decoder associated to this raster.
TeProjection * | projection ()
| Returns a pointer to the raster projection.
bool | setElement (int col, int lin, double val, int band=0)
| Sets the value of a element of the raster.
bool | getElement (int col, int lin, double &val, int band=0)
| Gets the value of a element of the raster.
bool | fillRaster (TeRaster *dstRaster, TeRasterTransform *transf=0, bool bestRes=true)
| Fills a destination raster with the raster elements.
bool | init ()
| Initalize the raster decoding tool from its parameters.
bool | init (TeRasterParams &pars)
| Initalize the raster decoding tool from a raster parameters structure.
void | clear ()
| Clear internal structures and disable the raster decoding tool.
TeCoord2D | index2Coord (TeCoord2D pt)
| Transform a coordinate from line/column domain to projection domain.
TeCoord2D | coord2Index (TeCoord2D pt)
| Transform a coordinate from projection domain domain to line/column.
iterator | begin ()
| Returns an iterator to the first element of the raster.
iteratorPoly | begin (const TePolygon &poly, TeStrategicIterator st, int band=0)
| Returns an iterator to the first element of the raster IN or OUT the polygon.
iterator | end ()
| Returns the end past one position of the elements of the raster.
iteratorPoly | end (const TePolygon &poly, TeStrategicIterator st, int band=0)
| Returns an iterator to the end element of the raster.
bool | selectBlocks (TeBox &bb, int resFac, TeRasterParams &parBlock)
| Select all blocks of raster, in a certain resolution factor that intercepts a given bounding box.
int | numberOfSelectedBlocks ()
| Returns the number of blocks selected by the last block selection.
bool | fetchRasterBlock (TeDecoderMemory *memDec)
| Returns the current block of a set selected by the last block selection.
void | clearBlockSelection ()
| Clears the current selection of a set selected by the last block selection.
bool | setElement (int col, int lin, double Rval, double Gval, double Bval, unsigned int=255)
| An optimizated method to set values raster images.
const string & | errorMessage () const
| Give access to the last message detected by the raster manipulation.

## Detailed Description

Support for a raster geometry.

Examples:

  importGridData.cpp, importJPEG.cpp, TePDIArithmetic_test.cpp, TePDIBDFilter_test.cpp, TePDIBlender_test.cpp, TePDIColorTransform_test.cpp, TePDIContrast_test.cpp, TePDICorrelationMatching_test.cpp, TePDIDecorrelationEnhancement_test.cpp, TePDIFFT_test.cpp, TePDIFusion_test.cpp, TePDIHants_test.cpp, TePDIHaralick_test.cpp, TePDIHistogram_test.cpp, TePDIJointHistogram_test.cpp, TePDILinearFilter_test.cpp, TePDIMIMatching_test.cpp, TePDIMixModel_test.cpp, TePDIMMIOMatching_test.cpp, TePDIMorfFilter_test.cpp, TePDIMosaic_test.cpp, TePDIOFMatching_test.cpp, TePDIParallelSegmenter_test.cpp, TePDIPrincipalComponents_test.cpp, TePDIRadarFilters_test.cpp, TePDIRegister_test.cpp, TePDISegmentation_test.cpp, TePDISensorSimulator_test.cpp, TePDIStatistic_test.cpp, TePDIUtils_test.cpp, and TePDIWavelets_test.cpp.

## Constructor & Destructor Documentation

TeRaster::TeRaster | ( | const string & | filename,
|  | const char & | mode = `'r'`
| ) |  |

Constructor from file.

This method tries to instatiate a decoder for this data from the file extension of the filename.

Parameters:

  filename | the name of a file that contains the raster data
  mode | file opening mode ('r', 'w' or 'c')

Obs: the method init should be called before any attempt to read or write this raster data

TeRaster::TeRaster | ( | TeRasterParams & | pars | ) |

Constructor from parameters.

This method tries to instatiate a decoder for this data. It uses the identification explicitly described or the extension of a file name specified in the parameters.

Parameters:

  pars | a raster parameters structure that contains information about the raster

Obs: the method init should be called before any attempt to read or write data
  to the raster.

TeRaster::TeRaster | ( | int | ncols,
|  | int | nlines,
|  | int | nbands,
|  | TeDataType | elemType
| ) |  |

Contructor from commom parameters.

TeRaster::TeRaster | ( |  | ) | `[inline]`

Empty constructor.

TeRaster::~TeRaster | ( |  | ) |

Destructor.

## Member Function Documentation

TeRaster::iterator TeRaster::begin | ( | void |  | ) |

Returns an iterator to the first element of the raster.

TeRaster::iteratorPoly TeRaster::begin | ( | const TePolygon & | poly,
|  | TeStrategicIterator | st,
|  | int | band = `0`
| ) |  |

Returns an iterator to the first element of the raster IN or OUT the polygon.

Parameters:

  poly | polygon that delimitates the iterator traversal
  st | stragetegy used to decide if a pixel is in or out a polygon
  band | optional band restriction

void TeRaster::clear | ( | void |  | ) |

Clear internal structures and disable the raster decoding tool.

Examples:
  importGridData.cpp, and importJPEG.cpp.

void TeRaster::clearBlockSelection | ( |  | ) |

Clears the current selection of a set selected by the last block selection.

TeCoord2D TeRaster::coord2Index | ( | TeCoord2D | pt | ) | `[inline]`

Transform a coordinate from projection domain domain to line/column.

TeDecoder * TeRaster::decoder | ( |  | ) | `[inline]`

Returns a pointer to the decoder associated to this raster.

TeGeomRep TeRaster::elemType | ( |  | ) | `[inline]`

Returns the type of the geometry.

TeRaster::iterator TeRaster::end | ( | void |  | ) |

Returns the end past one position of the elements of the raster.

TeRaster::iteratorPoly TeRaster::end | ( | const TePolygon & | poly,
|  | TeStrategicIterator | st,
|  | int | band = `0`
| ) |  |

Returns an iterator to the end element of the raster.

Parameters:

  poly | polygon that delimitates the iterator traversal
  st | stragetegy used to decide if a pixel is in or out a polygon
  band | optional band restriction

const string & TeRaster::errorMessage | ( |  | ) | const`[inline]`

Give access to the last message detected by the raster manipulation.

bool TeRaster::fetchRasterBlock | ( | TeDecoderMemory * | memDec | ) |

Returns the current block of a set selected by the last block selection.

bool TeRaster::fillRaster | ( | TeRaster * | dstRaster,
|  | TeRasterTransform * | transf = `0`,
|  | bool | bestRes = `true`
| ) |  |

Fills a destination raster with the raster elements.

bool TeRaster::getElement | ( | int | col,
|  | int | lin,
|  | double & | val,
|  | int | band = `0`
| ) |  |

Gets the value of a element of the raster.

Parameters:

  col | column number
  lin | line number
  val | element value
  band | band number

Examples:
  TePDIOFMatching_test.cpp.

TeCoord2D TeRaster::index2Coord | ( | TeCoord2D | pt | ) | `[inline]`

Transform a coordinate from line/column domain to projection domain.

bool TeRaster::init | ( |  | ) |

Initalize the raster decoding tool from its parameters.

The result of this method depends on the mode_ specified in the parameters.

'r' : initializes a raster with reading only permission. If the source
  of the data does not exist it will fail.

'w' : initializes a raster with reading and writting permission. If the source
  of the data does not exist it will fail.

'c' : creates a new raster data with default values. Initializes it with
  reading and writting permision. Fails if creation fails.

Examples:
  importGridData.cpp, importJPEG.cpp, TePDICorrelationMatching_test.cpp, TePDIMIMatching_test.cpp, TePDIMMIOMatching_test.cpp, and TePDIOFMatching_test.cpp.

bool TeRaster::init | ( | TeRasterParams & | pars | ) |

Initalize the raster decoding tool from a raster parameters structure.

Returns:
  true if raster is read to be read/written and false otherwise.

int TeRaster::nBands | ( |  | ) | `[inline]`

Returns the number of lines of the raster.

int TeRaster::numberOfSelectedBlocks | ( |  | ) |

Returns the number of blocks selected by the last block selection.

const TeRasterParams & TeRaster::params | ( |  | ) | const`[inline]`

Returns the const parameters of the raster.

Examples:
  TePDIOFMatching_test.cpp.

TeRasterParams & TeRaster::params | ( |  | ) | `[inline]`

Returns the parameters of the raster.

TeProjection * TeRaster::projection | ( |  | ) | `[inline]`

Returns a pointer to the raster projection.

Examples:
  importGridData.cpp, and importJPEG.cpp.

bool TeRaster::selectBlocks | ( | TeBox & | bb,
|  | int | resFac,
|  | TeRasterParams & | parBlock
| ) |  |

Select all blocks of raster, in a certain resolution factor that intercepts a given bounding box.

void TeRaster::setDecoder | ( | TeDecoder * | dec | ) |

Associate a decoder to a raster.

Parameters:

  dec | pointer to a raster decoder

bool TeRaster::setElement | ( | int | col,
|  | int | lin,
|  | double | Rval,
|  | double | Gval,
|  | double | Bval,
|  | unsigned int | transp = `255`
| ) |  |

An optimizated method to set values raster images.

bool TeRaster::setElement | ( | int | col,
|  | int | lin,
|  | double | val,
|  | int | band = `0`
| ) |  |

Sets the value of a element of the raster.

Parameters:

  col | column number
  lin | line number
  val | element value
  band | band number

Examples:
  TePDICorrelationMatching_test.cpp, TePDIMIMatching_test.cpp, TePDIMMIOMatching_test.cpp, and TePDIOFMatching_test.cpp.

bool TeRaster::status | ( |  | ) | `[inline]`

Returns status of the raster as a Boolean value.

void TeRaster::updateParams | ( | TeRasterParams & | par | ) |

Update the parametes of a raster file.

Parameters:

  par | a new raster parameters structure

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeRaster.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeRaster.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines