All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
te::mem::ExpansibleRaster Class Reference

A raster (stored in memory and eventually swapped to disk) where it is possible to dynamically add lines/columns/bands. More...

#include <ExpansibleRaster.h>

Inheritance diagram for te::mem::ExpansibleRaster:
te::rst::Raster te::dt::AbstractData

Public Member Functions

bool addBottomBands (const unsigned int number)
 New bands will be added at the bottom of the raster (after de the last band). More...
 
bool addBottomLines (const unsigned int number)
 New lines will be added at the bottom of the raster (after de the last line). More...
 
bool addLeftColumns (const unsigned int number)
 New columns will be added at the left of the raster (before the first column). More...
 
bool addRightColumns (const unsigned int number)
 New columns will be added at the right of the raster (after the last column). More...
 
bool addTopBands (const unsigned int number)
 New bands will be added at the top of the raster (before the first band). More...
 
bool addTopLines (const unsigned int number)
 New lines will be added at the top of the raster (before the first line). More...
 
RastercallOperator (std::complex< double >(*f)(std::complex< double >, std::complex< double >), const Raster &rhs)
 It calls a parameter function f to apply in all pixels from two rasters, e.g. pixel = f(lhs, rhs);. More...
 
te::dt::AbstractDataclone () const
 It returns a clone of this object. More...
 
 ExpansibleRaster (const unsigned char maxMemPercentUsed, te::rst::Grid *grid, const std::vector< te::rst::BandProperty * > bandsProperties)
 Constructor. More...
 
 ExpansibleRaster (te::rst::Grid *grid, const std::vector< te::rst::BandProperty * > bandsProperties, const unsigned int maxNumberOfRAMBlocks)
 Constructor. More...
 
te::common::AccessPolicy getAccessPolicy () const
 Returns the raster access policy. More...
 
const te::rst::BandgetBand (std::size_t i) const
 Returns the raster i-th band. More...
 
te::rst::BandgetBand (std::size_t i)
 Returns the raster i-th band. More...
 
int getBandDataType (std::size_t i) const
 Returns the data type in a particular band (or dimension). More...
 
te::gm::EnvelopegetExtent ()
 Returns the geographic extension of the raster data. More...
 
const te::gm::EnvelopegetExtent () const
 Returns the geographic extension of the raster data. More...
 
te::gm::EnvelopegetExtent (int srid, te::gm::Envelope *roi=0) const
 Returns the geographic extension of the raster data, in a given SRS (distinct from its original one). More...
 
Grid * getGrid ()
 It returns the raster grid. More...
 
const Grid * getGrid () const
 It returns the raster grid. More...
 
std::map< std::string,
std::string > 
getInfo () const
 It returns additional information about the raster. More...
 
virtual void getIValue (unsigned int c, unsigned int r, double &value, std::size_t b=0) const
 Returns the imaginary attribute value in a complex band of a cell. More...
 
const std::string & getName () const
 Returns the raster name. More...
 
std::size_t getNumberOfBands () const
 Returns the number of bands (dimension of cells attribute values) in the raster. More...
 
unsigned int getNumberOfColumns () const
 Returns the raster number of columns. More...
 
unsigned int getNumberOfRows () const
 Returns the raster number of rows. More...
 
Grid * getResampledGrid (int scale)
 Return the raster grid for a specific scale. More...
 
double getResolutionX () const
 Returns the raster horizontal (x-axis) resolution. More...
 
double getResolutionY () const
 Returns the raster vertical (y-axis) resolution. More...
 
int getSRID () const
 Returns the raster spatial reference system identifier. More...
 
int getTypeCode () const
 It returns the data type code associated to the data value. More...
 
virtual void getValue (unsigned int c, unsigned int r, double &value, std::size_t b=0) const
 Returns the attribute value of a band of a cell. More...
 
virtual void getValue (unsigned int c, unsigned int r, std::complex< double > &value, std::size_t b=0) const
 Returns the imaginary attribute value in a complex band of a cell. More...
 
virtual void getValues (unsigned int c, unsigned int r, std::vector< double > &values) const
 Returns the imaginary attribute values in all complex bands of a cell. More...
 
virtual void getValues (unsigned int c, unsigned int r, std::vector< std::complex< double > > &values) const
 Returns the imaginary attribute values in all complex bands of a cell. More...
 
void open (const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)
 Opens a raster. More...
 
virtual Rasteroperator*= (Raster &rhs)
 It returns the raster product (pixel by pixel). More...
 
virtual Rasteroperator+= (Raster &rhs)
 It returns the raster sum (pixel by pixel). More...
 
virtual Rasteroperator-= (Raster &rhs)
 It returns the raster subtraction (pixel by pixel). More...
 
virtual Rasteroperator/= (Raster &rhs)
 It returns the raster division (pixel by pixel). More...
 
const te::rst::Bandoperator[] (std::size_t i) const
 Access band in i position. More...
 
te::rst::Bandoperator[] (std::size_t i)
 Access band in i position. More...
 
virtual void rasterize (std::vector< te::gm::Geometry * > g, std::vector< double > vp, std::size_t b=0)
 Rasterizes a given vector of geometries. More...
 
virtual Rasterresample (int method, unsigned int drow, unsigned int dcolumn, unsigned int height, unsigned int width, unsigned int newheight, unsigned int newwidth, const std::map< std::string, std::string > &rinfo)
 Resample a subset of the raster, given a box. More...
 
virtual Rasterresample (int method, int scale, const std::map< std::string, std::string > &rinfo)
 Resample raster. More...
 
void setAccessPolicy (te::common::AccessPolicy p)
 Sets the raster access policy. More...
 
virtual void setIValue (unsigned int c, unsigned int r, const double value, std::size_t b=0)
 Sets the imaginary attribute value in a complex band of a cell. More...
 
void setName (const std::string name)
 Sets the raster name. More...
 
virtual void setValue (unsigned int c, unsigned int r, const double value, std::size_t b=0)
 Sets the attribute value in a band of a cell. More...
 
virtual void setValue (unsigned int c, unsigned int r, const std::complex< double > &value, std::size_t b=0)
 Sets the imaginary attribute value in a complex band of a cell. More...
 
virtual void setValues (unsigned int c, unsigned int r, const std::vector< double > &values)
 Sets the imaginary attribute values in all complex bands of a cell. More...
 
virtual void setValues (unsigned int c, unsigned int r, const std::vector< std::complex< double > > &values)
 Sets the imaginary attribute values in all complex bands of a cell. More...
 
std::string toString (void) const
 It returns the data value in a string notation. More...
 
virtual Rastertransform (int srid, const std::map< std::string, std::string > &rinfo, int m=1) const
 Reprojects this raster to a distinct SRS. This method reprojects this raster to a distinct SRS. The output resolution is calculated in order to maintain the same number of pixels as in this raster. More...
 
virtual Rastertransform (int srid, double llx, double lly, double urx, double ury, const std::map< std::string, std::string > &rinfo, int m=1) const
 Reprojects a squared portion of this raster to a distinct SRS. This method reprojects a squared portion of this raster to a distinct SRS. The output resolution is calculated in order to maintain the same number of pixels as in the desired portion of this raster. More...
 
virtual Rastertransform (int srid, double llx, double lly, double urx, double ury, double resx, double resy, const std::map< std::string, std::string > &rinfo, int m=1) const
 Reprojects a squared portion of this raster to another SRS with a desired resolution. More...
 
virtual Rastertrim (const te::gm::Envelope *env, const std::map< std::string, std::string > &rinfo)
 Subsetting operation for trimming (cropping) the raster. More...
 
virtual void vectorize (std::size_t, std::vector< te::gm::Geometry * > &)
 Vectorizes a given raster band, using GDALPolygonize function. More...
 
 ~ExpansibleRaster ()
 

Protected Member Functions

double applyScale (int i, const double &v)
 Scales a value according to a specific resampling scale. More...
 
void dummyFillAllBlocks ()
 Fill all blocks with dummy values. More...
 
void dummyFillBlocks (const std::vector< ExpansibleBandBlocksManager::BlockIndex3D > &blocksCoords)
 Fill the required blocks with dummy values. More...
 
void free ()
 Free all allocated internal resources and go back to the initial state. More...
 

Protected Attributes

std::vector< ExpansibleBand * > m_bands
 Internal raster bands. More...
 
ExpansibleBandBlocksManager m_blocksManager
 Internal blocks manager. More...
 
Grid * m_grid
 The spatial support for raster data. More...
 
std::string m_name
 The raster name. More...
 
te::common::AccessPolicy m_policy
 The access policy, can be te::common::{NoAccess, RAccess, RWAccess, WAccess}. More...
 

Private Member Functions

 ExpansibleRaster ()
 
 ExpansibleRaster (const Raster &rhs)
 
 ExpansibleRaster (te::rst::Grid *grid, te::common::AccessPolicy p=te::common::RAccess)
 

Detailed Description

A raster (stored in memory and eventually swapped to disk) where it is possible to dynamically add lines/columns/bands.

Note
The first band blocking scheme will be taken as reference for the other bands.
Adding lines/columns may add extra lines/columns to correctly fit the internal blocking structure.
The geographic limits will be automatically adjust following the requested expansion.

Definition at line 52 of file ExpansibleRaster.h.

Constructor & Destructor Documentation

te::mem::ExpansibleRaster::ExpansibleRaster ( const unsigned char  maxMemPercentUsed,
te::rst::Grid grid,
const std::vector< te::rst::BandProperty * >  bandsProperties 
)

Constructor.

Parameters
maxMemPercentUsedThe maximum free memory percentual to use valid range: [1:100].
gridThe grid definition. The Raster will take its ownership.
bandsPropertiesThe bands propeties (the raster will take their ownership);

Definition at line 54 of file ExpansibleRaster.cpp.

References dummyFillAllBlocks(), te::rst::Grid::getNumberOfColumns(), te::rst::Grid::getNumberOfRows(), te::rst::GetPixelSize(), te::common::GetTotalPhysicalMemory(), te::common::GetTotalVirtualMemory(), te::common::GetUsedVirtualMemory(), te::mem::ExpansibleBandBlocksManager::initialize(), m_bands, m_blocksManager, TLINTERNAL_EXPANSIBLERASTER_MAXDISKFILESSIZE, and TR_MEMORY.

te::mem::ExpansibleRaster::ExpansibleRaster ( te::rst::Grid grid,
const std::vector< te::rst::BandProperty * >  bandsProperties,
const unsigned int  maxNumberOfRAMBlocks 
)

Constructor.

Parameters
gridThe grid definition. The Raster will take its ownership.
bandsPropertiesThe bands propeties (the raster will take their ownership);
maxNumberOfRAMBlocksThe maximum number of RAM blocks.

Definition at line 120 of file ExpansibleRaster.cpp.

References dummyFillAllBlocks(), te::rst::Grid::getNumberOfColumns(), te::rst::Grid::getNumberOfRows(), te::rst::GetPixelSize(), te::mem::ExpansibleBandBlocksManager::initialize(), m_bands, m_blocksManager, TLINTERNAL_EXPANSIBLERASTER_MAXDISKFILESSIZE, and TR_MEMORY.

te::mem::ExpansibleRaster::~ExpansibleRaster ( )

Definition at line 173 of file ExpansibleRaster.cpp.

te::mem::ExpansibleRaster::ExpansibleRaster ( )
private

Definition at line 40 of file ExpansibleRaster.cpp.

te::mem::ExpansibleRaster::ExpansibleRaster ( const Raster rhs)
private

Definition at line 44 of file ExpansibleRaster.cpp.

te::mem::ExpansibleRaster::ExpansibleRaster ( te::rst::Grid grid,
te::common::AccessPolicy  p = te::common::RAccess 
)
private

Definition at line 49 of file ExpansibleRaster.cpp.

Member Function Documentation

bool te::mem::ExpansibleRaster::addBottomBands ( const unsigned int  number)

New bands will be added at the bottom of the raster (after de the last band).

Parameters
numberThe number of bands to add.
Returns
true if OK, false on errors.

Definition at line 470 of file ExpansibleRaster.cpp.

bool te::mem::ExpansibleRaster::addBottomLines ( const unsigned int  number)

New lines will be added at the bottom of the raster (after de the last line).

Parameters
numberThe number of lines to add.
Returns
true if OK, false on errors.

Definition at line 252 of file ExpansibleRaster.cpp.

bool te::mem::ExpansibleRaster::addLeftColumns ( const unsigned int  number)

New columns will be added at the left of the raster (before the first column).

Parameters
numberThe number of columns to add.
Returns
true if OK, false on errors.

Definition at line 317 of file ExpansibleRaster.cpp.

bool te::mem::ExpansibleRaster::addRightColumns ( const unsigned int  number)

New columns will be added at the right of the raster (after the last column).

Parameters
numberThe number of columns to add.
Returns
true if OK, false on errors.

Definition at line 371 of file ExpansibleRaster.cpp.

bool te::mem::ExpansibleRaster::addTopBands ( const unsigned int  number)

New bands will be added at the top of the raster (before the first band).

Parameters
numberThe number of bands to add.
Returns
true if OK, false on errors.

Definition at line 436 of file ExpansibleRaster.cpp.

References te::rst::Band::getProperty().

bool te::mem::ExpansibleRaster::addTopLines ( const unsigned int  number)

New lines will be added at the top of the raster (before the first line).

Parameters
numberThe number of lines to add.
Returns
true if OK, false on errors.

Definition at line 201 of file ExpansibleRaster.cpp.

double te::rst::Raster::applyScale ( int  i,
const double &  v 
)
protectedinherited

Scales a value according to a specific resampling scale.

Parameters
iThe scale to apply.
vThe value to be scaled.
Returns
The scaled value.

Definition at line 542 of file Raster.cpp.

Raster& te::rst::Raster::callOperator ( std::complex< double >(*)(std::complex< double >, std::complex< double >)  f,
const Raster rhs 
)
inherited

It calls a parameter function f to apply in all pixels from two rasters, e.g. pixel = f(lhs, rhs);.

Parameters
(*f)a function with the signature complex<double>(*f)(complex<double>, complex<double>), const Raster& rhs)
rhsThe rhs raster to apply the function.
Returns
The resultant raster.
te::dt::AbstractData * te::mem::ExpansibleRaster::clone ( ) const
virtual

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

Definition at line 188 of file ExpansibleRaster.cpp.

void te::mem::ExpansibleRaster::dummyFillBlocks ( const std::vector< ExpansibleBandBlocksManager::BlockIndex3D > &  blocksCoords)
protected
void te::mem::ExpansibleRaster::free ( )
protected

Free all allocated internal resources and go back to the initial state.

Definition at line 495 of file ExpansibleRaster.cpp.

const te::rst::Band* te::mem::ExpansibleRaster::getBand ( std::size_t  i) const
inlinevirtual

Returns the raster i-th band.

Parameters
iThe band index.
Warning
The caller is reponsible for providing a valid band index.

Implements te::rst::Raster.

Definition at line 97 of file ExpansibleRaster.h.

te::rst::Band* te::mem::ExpansibleRaster::getBand ( std::size_t  i)
inlinevirtual

Returns the raster i-th band.

Parameters
iThe band index.
Warning
The caller is reponsible for providing a valid band index.

Implements te::rst::Raster.

Definition at line 103 of file ExpansibleRaster.h.

int te::mem::ExpansibleRaster::getBandDataType ( std::size_t  i) const
inlinevirtual

Returns the data type in a particular band (or dimension).

Note
The data types are listed in terralib/datatype/DataTypes.h
Parameters
iThe desired band.
Returns
The data type in a particular band (or dimension).

Implements te::rst::Raster.

Definition at line 91 of file ExpansibleRaster.h.

const te::gm::Envelope * te::rst::Raster::getExtent ( ) const
inherited

Returns the geographic extension of the raster data.

Definition at line 109 of file Raster.cpp.

te::gm::Envelope * te::rst::Raster::getExtent ( int  srid,
te::gm::Envelope roi = 0 
) const
inherited

Returns the geographic extension of the raster data, in a given SRS (distinct from its original one).

Parameters
sridThe target SRS id.
roiPointer to a region of interest. If NULL the original extenstion will be considered.
Returns
A pointer the raster extension in a given SRS or NULL if it fails.
Note
The caller will take the ownership of the returned pointer.

Definition at line 114 of file Raster.cpp.

References te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

te::rst::Grid * te::rst::Raster::getGrid ( )
inherited

It returns the raster grid.

Definition at line 94 of file Raster.cpp.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), te::rst::Copy(), te::tools::rastermanager::RasterManager::copyRaster(), te::mem::Raster::create(), te::rst::CreateCopy(), te::rp::Segmenter::createCutOffLinesTiff(), te::rp::SequenceMosaic::createDiskRasterCopy(), te::rp::SequenceMosaic::createRasterDataSet(), te::map::DrawRaster(), te::rp::GeoMosaic::execute(), te::rp::Register::execute(), te::rp::Filter::execute(), te::rp::TiePointsMosaic::execute(), te::rp::Skeleton::execute(), te::rp::Contrast::execute(), te::rp::SequenceMosaic::execute(), te::rp::Segmenter::execute(), te::map::GetExtentRaster(), te::rp::GetRandomPointsInRaster(), te::qt::widgets::Info::getRasterInfo(), te::map::RasterLayer::getSchema(), te::rp::Blender::initialize(), InterpolateIn(), te::rst::LineIterator< T >::LineIterator(), te::qt::widgets::TiePointsLocatorDialog::on_autoAcquireTiePointsPushButton_clicked(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_coordTracked(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay1_extentChanged(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_coordTracked(), te::qt::widgets::TiePointsLocatorDialog::on_mapDisplay2_extentChanged(), te::qt::widgets::TiePointLocatorWidget::onAutoAcquireTiePointsToolButtonClicked(), te::rst::PointSetIterator< T >::PointSetIterator(), te::rst::PolygonIterator< T >::PolygonIterator(), te::rst::ProxyRaster::ProxyRaster(), te::serialize::xml::Save(), te::rp::IHSFusion::saveIHSData(), and te::rp::Segmenter::segmenterThreadEntry().

const te::rst::Grid * te::rst::Raster::getGrid ( ) const
inherited

It returns the raster grid.

Definition at line 99 of file Raster.cpp.

std::map< std::string, std::string > te::mem::ExpansibleRaster::getInfo ( ) const
virtual

It returns additional information about the raster.

The return of thi smethod is driver dependent.

Returns
Additional information about the raster.

Implements te::rst::Raster.

Definition at line 183 of file ExpansibleRaster.cpp.

void te::rst::Raster::getIValue ( unsigned int  c,
unsigned int  r,
double &  value,
std::size_t  b = 0 
) const
virtualinherited

Returns the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe attribute value to be assigned.
bA particular band of the cell attribute. Default value 0.
Warning
The caller is responsible for providing correct values for the range [c x r x b].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Definition at line 238 of file Raster.cpp.

const std::string & te::rst::Raster::getName ( ) const
inherited

Returns the raster name.

Definition at line 79 of file Raster.cpp.

Referenced by te::map::DrawRaster(), and te::serialize::xml::Save().

std::size_t te::mem::ExpansibleRaster::getNumberOfBands ( ) const
inlinevirtual

Returns the number of bands (dimension of cells attribute values) in the raster.

Implements te::rst::Raster.

Definition at line 86 of file ExpansibleRaster.h.

unsigned int te::rst::Raster::getNumberOfColumns ( ) const
inherited

Returns the raster number of columns.

Definition at line 213 of file Raster.cpp.

Referenced by te::rst::AbstractBandIterator< T >::AbstractBandIterator(), te::qt::widgets::SegmenterWizardPage::apply(), te::qt::widgets::ContrastWizardPage::apply(), te::mem::Band::Band(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), te::rst::BandIteratorWithMask< T >::BandIteratorWithMask(), te::rst::Band::callOperator(), te::rp::ConvertIHS2RGB(), te::rp::ConvertRBG2IHS(), te::rst::Copy(), te::tools::rastermanager::RasterManager::copyRaster(), te::rp::SequenceMosaic::createDiskRasterCopy(), te::rp::SequenceMosaic::createRasterDataSet(), te::rp::Filter::DilationFilter(), te::qt::widgets::Canvas::drawImage(), te::map::DrawRaster(), te::rp::Filter::ErosionFilter(), te::rp::Contrast::execHistogramEqualizationContrast(), te::rp::Contrast::execSetMeanAndStdContrast(), te::rp::GeoMosaic::execute(), te::rp::Register::execute(), te::rp::TiePointsMosaic::execute(), te::rp::Contrast::execute(), te::rp::SequenceMosaic::execute(), te::rp::Segmenter::execute(), te::rst::FillBand(), te::rp::Segmenter::genImageHCutOffProfile(), te::rp::Segmenter::genImageVCutOffProfile(), te::map::GetExtentRaster(), te::rp::ClassifierMAPStrategy::getPrioriProbabilities(), te::rp::GetRandomPointsInRaster(), te::qt::widgets::Info::getRasterInfo(), te::rp::IHSFusion::getRGBRange(), te::rp::Blender::initialize(), te::rp::Skeleton::initialize(), te::rp::TiePointsLocator::initialize(), te::rp::SegmenterRegionGrowingStrategy::initializeSegments(), te::rst::Interpolator::Interpolator(), te::rp::Skeleton::loadData(), te::rp::IHSFusion::loadIHSData(), te::rp::Filter::MeanFilter(), te::rp::Filter::MedianFilter(), te::rp::Filter::ModeFilter(), te::qt::widgets::TiePointsLocatorDialog::on_autoAcquireTiePointsPushButton_clicked(), te::qt::widgets::TiePointLocatorWidget::onAutoAcquireTiePointsToolButtonClicked(), te::idl::rp::RegionGrowingSegmenter(), te::rp::Contrast::remapBandLevels(), te::rst::Reproject(), te::rst::Raster::resample(), te::rp::Filter::RobertsFilter(), te::rp::IHSFusion::saveIHSData(), te::rp::Segmenter::segmenterThreadEntry(), te::rp::Filter::SobelFilter(), te::rp::IHSFusion::swapIntensity(), te::mem::TiledBand::TiledBand(), and te::rp::Filter::UserDefinedFilter().

unsigned int te::rst::Raster::getNumberOfRows ( ) const
inherited

Returns the raster number of rows.

Definition at line 208 of file Raster.cpp.

Referenced by te::rst::AbstractBandIterator< T >::AbstractBandIterator(), te::qt::widgets::SegmenterWizardPage::apply(), te::qt::widgets::ContrastWizardPage::apply(), te::mem::Band::Band(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), te::rst::BandIteratorWithMask< T >::BandIteratorWithMask(), te::rst::Band::callOperator(), te::rp::ConvertIHS2RGB(), te::rp::ConvertRBG2IHS(), te::rst::Copy(), te::tools::rastermanager::RasterManager::copyRaster(), te::rp::SequenceMosaic::createDiskRasterCopy(), te::rp::SequenceMosaic::createRasterDataSet(), te::rp::Filter::DilationFilter(), te::qt::widgets::Canvas::drawImage(), te::map::DrawRaster(), te::rp::Filter::ErosionFilter(), te::rp::Contrast::execHistogramEqualizationContrast(), te::rp::Contrast::execSetMeanAndStdContrast(), te::rp::GeoMosaic::execute(), te::rp::Register::execute(), te::rp::TiePointsMosaic::execute(), te::rp::Contrast::execute(), te::rp::SequenceMosaic::execute(), te::rp::Segmenter::execute(), te::rst::FillBand(), te::rp::Segmenter::genImageHCutOffProfile(), te::rp::Segmenter::genImageVCutOffProfile(), te::map::GetExtentRaster(), te::rp::ClassifierMAPStrategy::getPrioriProbabilities(), te::rp::GetRandomPointsInRaster(), te::qt::widgets::Info::getRasterInfo(), te::rp::IHSFusion::getRGBRange(), te::rp::Blender::initialize(), te::rp::Skeleton::initialize(), te::rp::TiePointsLocator::initialize(), te::rp::SegmenterRegionGrowingStrategy::initializeSegments(), te::rst::Interpolator::Interpolator(), te::rp::Skeleton::loadData(), te::rp::IHSFusion::loadIHSData(), te::rp::Filter::MeanFilter(), te::rp::Filter::MedianFilter(), te::rp::Filter::ModeFilter(), te::qt::widgets::TiePointsLocatorDialog::on_autoAcquireTiePointsPushButton_clicked(), te::qt::widgets::TiePointLocatorWidget::onAutoAcquireTiePointsToolButtonClicked(), te::idl::rp::RegionGrowingSegmenter(), te::rp::Contrast::remapBandLevels(), te::rst::Reproject(), te::rst::Raster::resample(), te::rp::Filter::RobertsFilter(), te::rp::IHSFusion::saveIHSData(), te::rp::Segmenter::segmenterThreadEntry(), te::rp::Filter::SobelFilter(), te::rp::IHSFusion::swapIntensity(), te::mem::TiledBand::TiledBand(), and te::rp::Filter::UserDefinedFilter().

te::rst::Grid * te::rst::Raster::getResampledGrid ( int  scale)
inherited

Return the raster grid for a specific scale.

Parameters
scaleThe desired sacale of interpolation (use - to shrink or + to enlarge).
Returns
The raster grid.
Note
The caller will take the ownership of the returned pointer.

Definition at line 530 of file Raster.cpp.

double te::rst::Raster::getResolutionX ( ) const
inherited

Returns the raster horizontal (x-axis) resolution.

Definition at line 218 of file Raster.cpp.

Referenced by te::rp::SequenceMosaic::execute(), InterpolateIn(), te::rst::LineIterator< T >::LineIterator(), and te::rst::Reproject().

double te::rst::Raster::getResolutionY ( ) const
inherited

Returns the raster vertical (y-axis) resolution.

Definition at line 223 of file Raster.cpp.

Referenced by te::rp::SequenceMosaic::execute(), InterpolateIn(), te::rst::LineIterator< T >::LineIterator(), and te::rst::Reproject().

int te::rst::Raster::getTypeCode ( ) const
inlinevirtualinherited

It returns the data type code associated to the data value.

Returns
The data type code associated to the data value.

Implements te::dt::AbstractData.

Definition at line 361 of file Raster.h.

References te::dt::RASTER_TYPE.

void te::rst::Raster::getValue ( unsigned int  c,
unsigned int  r,
double &  value,
std::size_t  b = 0 
) const
virtualinherited

Returns the attribute value of a band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueTo return the attribute value.
bA particular band of the cell attribute.
Warning
The caller is responsible for providing correct values for the range [c x r x b].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Definition at line 228 of file Raster.cpp.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), te::tools::rastermanager::RasterManager::copyRaster(), te::qt::widgets::Canvas::drawImage(), te::rp::Segmenter::genImageHCutOffProfile(), te::rp::Segmenter::genImageVCutOffProfile(), te::rp::RasterAttributes::getMeans(), te::rp::ClassifierMAPStrategy::getPrioriProbabilities(), te::qt::widgets::Info::getRasterInfo(), te::rp::RasterAttributes::getValuesFromRaster(), and te::rp::SegmenterRegionGrowingStrategy::initializeSegments().

void te::rst::Raster::getValue ( unsigned int  c,
unsigned int  r,
std::complex< double > &  value,
std::size_t  b = 0 
) const
virtualinherited

Returns the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe complex attribute value to be assigned (real, imaginary).
bA particular band of the cell attribute. Default value 0.
Warning
The caller is responsible for providing correct values for the range [c x r x b].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Definition at line 248 of file Raster.cpp.

void te::rst::Raster::getValues ( unsigned int  c,
unsigned int  r,
std::vector< double > &  values 
) const
virtualinherited

Returns the imaginary attribute values in all complex bands of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valuesA vector of attribute values to be assigned (not complex values).
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Definition at line 258 of file Raster.cpp.

Referenced by te::rst::Copy(), te::tools::rastermanager::RasterManager::copyRaster(), and te::map::GetExtentRaster().

void te::rst::Raster::getValues ( unsigned int  c,
unsigned int  r,
std::vector< std::complex< double > > &  values 
) const
virtualinherited

Returns the imaginary attribute values in all complex bands of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valuesA vector of complex attribute values to be assigned (real, imaginary).
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be read.

Definition at line 272 of file Raster.cpp.

void te::mem::ExpansibleRaster::open ( const std::map< std::string, std::string > &  rinfo,
te::common::AccessPolicy  p = te::common::RAccess 
)
virtual

Opens a raster.

Parameters
rinfoThe information needed by each driver to open the raster.
pAccess Policy.

Implements te::rst::Raster.

Definition at line 178 of file ExpansibleRaster.cpp.

te::rst::Raster & te::rst::Raster::operator*= ( Raster rhs)
virtualinherited

It returns the raster product (pixel by pixel).

Parameters
rhsThe raster to be multiplied, right-hand side.
Note
Both rasters must have the same properties, #bands, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster product.

Definition at line 354 of file Raster.cpp.

References te::rst::Raster::getNumberOfBands().

te::rst::Raster & te::rst::Raster::operator+= ( Raster rhs)
virtualinherited

It returns the raster sum (pixel by pixel).

Parameters
rhsThe raster to be added, right-hand side.
Note
Both rasters must have the same properties, #bands, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster sum.

Definition at line 334 of file Raster.cpp.

References te::rst::Raster::getNumberOfBands().

te::rst::Raster & te::rst::Raster::operator-= ( Raster rhs)
virtualinherited

It returns the raster subtraction (pixel by pixel).

Parameters
rhsThe raster to be subtracted, right-hand side.
Note
Both rasters must have the same properties, #bands, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster subtraction.

Definition at line 344 of file Raster.cpp.

References te::rst::Raster::getNumberOfBands().

te::rst::Raster & te::rst::Raster::operator/= ( Raster rhs)
virtualinherited

It returns the raster division (pixel by pixel).

Parameters
rhsThe raster to be divided, right-hand side.
Note
Both rasters must have the same properties, #bands, #columns, #rows, and data type.
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster division.

Definition at line 364 of file Raster.cpp.

References te::rst::Raster::getNumberOfBands().

const te::rst::Band& te::mem::ExpansibleRaster::operator[] ( std::size_t  i) const
inlinevirtual

Access band in i position.

Parameters
iThe band index.
Warning
The caller is reponsible for providing a valid band index.
Returns
A reference to the i-th band.

Implements te::rst::Raster.

Definition at line 109 of file ExpansibleRaster.h.

te::rst::Band& te::mem::ExpansibleRaster::operator[] ( std::size_t  i)
inlinevirtual

Access band in i position.

Parameters
iThe band index.
Warning
The caller is reponsible for providing a valid band index.
Returns
A reference to the i-th band.

Implements te::rst::Raster.

Definition at line 115 of file ExpansibleRaster.h.

void te::rst::Raster::rasterize ( std::vector< te::gm::Geometry * >  g,
std::vector< double >  vp,
std::size_t  b = 0 
)
virtualinherited

Rasterizes a given vector of geometries.

Parameters
gA vector of geometries to be rasterized.
vpA vector of pixel values for each geometry. Can have the same size of the vector of geometries, or be null.
bThe band index to rasterize.

Definition at line 565 of file Raster.cpp.

References te::rst::PolygonIterator< T >::begin(), te::rst::PolygonIterator< T >::end(), te::rst::PolygonIterator< T >::getColumn(), te::rst::Band::getRaster(), and te::rst::PolygonIterator< T >::getRow().

te::rst::Raster * te::rst::Raster::resample ( int  method,
unsigned int  drow,
unsigned int  dcolumn,
unsigned int  height,
unsigned int  width,
unsigned int  newheight,
unsigned int  newwidth,
const std::map< std::string, std::string > &  rinfo 
)
virtualinherited

Resample a subset of the raster, given a box.

Parameters
methodThe method of interpolation.
See Also
te::rst::Interpolator
Parameters
drowThe starting row to make a subset of the image.
dcolumnThe starting column to make a subset of the image.
heightThe height of the subset.
widthThe width of the subset.
newheightThe resampled height of the new raster.
newwidthThe resampled width of the new raster.
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
Returns
A pointer to the resampled raster if success and a null pointer otherwise.
Note
The caller will take the ownership of the returned pointer.
Warning
A scale of 0 is not allowed. Use 1, 2, 3, or -1, -2, 3...

Definition at line 482 of file Raster.cpp.

References te::rst::Interpolator::getValues(), te::rst::RasterFactory::make(), te::rst::Raster::setValues(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

Referenced by te::tools::rastermanager::RasterManager::changeResolution(), and te::gdal::Raster::resample().

te::rst::Raster * te::rst::Raster::resample ( int  method,
int  scale,
const std::map< std::string, std::string > &  rinfo 
)
virtualinherited

Resample raster.

Parameters
methodThe method of interpolation.
scaleThe scale of interpolation (use - to shrink or + to enlarge).
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
Returns
A pointer to the resampled raster if success and a null pointer otherwise.
Note
The caller will take the ownership of the returned pointer.
Warning
A scale of 0 is not allowed. Use 1, 2, 3, or -1, -2, 3...

Reimplemented in te::gdal::Raster.

Definition at line 440 of file Raster.cpp.

References te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Interpolator::getValues(), te::rst::RasterFactory::make(), and te::rst::Raster::setValues().

void te::rst::Raster::setAccessPolicy ( te::common::AccessPolicy  p)
inherited

Sets the raster access policy.

Parameters
pThe new raster access policy.

Definition at line 84 of file Raster.cpp.

void te::rst::Raster::setIValue ( unsigned int  c,
unsigned int  r,
const double  value,
std::size_t  b = 0 
)
virtualinherited

Sets the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe attribute value to be assigned.
bA particular band of the cell attribute. Default value 0.
Warning
The caller is responsible for providing correct values for the range [c x r x b].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Definition at line 243 of file Raster.cpp.

void te::rst::Raster::setName ( const std::string  name)
inherited

Sets the raster name.

Parameters
nameThe new raster name.

Definition at line 74 of file Raster.cpp.

void te::rst::Raster::setValue ( unsigned int  c,
unsigned int  r,
const double  value,
std::size_t  b = 0 
)
virtualinherited

Sets the attribute value in a band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe attribute value to be assigned.
bA particular band of the cell attribute.
Warning
The caller is responsible for providing correct values for the range [c x r x b].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Definition at line 233 of file Raster.cpp.

Referenced by te::rp::ConvertRBG2IHS(), te::tools::rastermanager::RasterManager::copyRaster(), te::rp::Filter::DilationFilter(), te::rp::Filter::ErosionFilter(), te::rp::GeoMosaic::execute(), te::rp::TiePointsMosaic::execute(), te::rp::SequenceMosaic::execute(), te::rp::SegmenterRegionGrowingStrategy::exportSegs2Tif(), InterpolateIn(), te::rp::Filter::MeanFilter(), te::rp::Filter::MedianFilter(), te::rp::Filter::ModeFilter(), te::rp::NormalizeRaster(), and te::rp::Filter::UserDefinedFilter().

void te::rst::Raster::setValue ( unsigned int  c,
unsigned int  r,
const std::complex< double > &  value,
std::size_t  b = 0 
)
virtualinherited

Sets the imaginary attribute value in a complex band of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valueThe complex attribute value to be assigned (real, imaginary).
bA particular band of the cell attribute. Default value 0.
Warning
The caller is responsible for providing correct values for the range [c x r x b].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Definition at line 253 of file Raster.cpp.

void te::rst::Raster::setValues ( unsigned int  c,
unsigned int  r,
const std::vector< double > &  values 
)
virtualinherited

Sets the imaginary attribute values in all complex bands of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valuesA vector of attribute values to be assigned (not complex values).
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Definition at line 286 of file Raster.cpp.

Referenced by te::rst::Copy(), te::tools::rastermanager::RasterManager::copyRaster(), te::map::GetExtentRaster(), te::rst::Raster::resample(), and te::rst::Raster::trim().

void te::rst::Raster::setValues ( unsigned int  c,
unsigned int  r,
const std::vector< std::complex< double > > &  values 
)
virtualinherited

Sets the imaginary attribute values in all complex bands of a cell.

Parameters
cThe column location of the cell.
rThe row location of the cell.
valuesA vector of complex attribute values to be assigned (real, imaginary).
Warning
The caller is responsible for providing correct values for the range [c x r].
Exceptions
ExceptionSubclasses may throw an exception if the data value can not be write.

Definition at line 294 of file Raster.cpp.

std::string te::rst::Raster::toString ( void  ) const
virtualinherited

It returns the data value in a string notation.

Returns
The data value in a string notation.

Implements te::dt::AbstractData.

Definition at line 302 of file Raster.cpp.

Referenced by te::tools::rastermanager::RasterManager::getRasterInfo().

te::rst::Raster * te::rst::Raster::transform ( int  srid,
const std::map< std::string, std::string > &  rinfo,
int  m = 1 
) const
virtualinherited

Reprojects this raster to a distinct SRS. This method reprojects this raster to a distinct SRS. The output resolution is calculated in order to maintain the same number of pixels as in this raster.

Parameters
sridThe target SRS identifier.
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
mThe method of interpolation to apply (default 1 = nearest neighbor).
See Also
te::rst::Interpolator
Returns
A pointer to the reprojected raster if success and a null pointer otherwise.
Note
The caller will take the ownership of the returned pointer.

Definition at line 550 of file Raster.cpp.

te::rst::Raster * te::rst::Raster::transform ( int  srid,
double  llx,
double  lly,
double  urx,
double  ury,
const std::map< std::string, std::string > &  rinfo,
int  m = 1 
) const
virtualinherited

Reprojects a squared portion of this raster to a distinct SRS. This method reprojects a squared portion of this raster to a distinct SRS. The output resolution is calculated in order to maintain the same number of pixels as in the desired portion of this raster.

Parameters
sridThe target SRS identifier.
llxLower-left X-coordinate of the portion to be reprojected (in the original SRS).
llyLower-left Y-coordinate of the portion to be reprojected (in the original SRS).
urxUpper-Right X-coordinate of the portion to be reprojected (in the original SRS).
urlUpper-Right Y-coordinate of the portion to be reprojected (in the original SRS).
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
mThe method of interpolation to apply (default 1 = nearest neighbor).
See Also
te::rst::Interpolator
Returns
A pointer to the reprojected raster if success and a null pointer otherwise.
Note
The caller will take the ownership of the returned pointer.

Definition at line 555 of file Raster.cpp.

te::rst::Raster * te::rst::Raster::transform ( int  srid,
double  llx,
double  lly,
double  urx,
double  ury,
double  resx,
double  resy,
const std::map< std::string, std::string > &  rinfo,
int  m = 1 
) const
virtualinherited

Reprojects a squared portion of this raster to another SRS with a desired resolution.

This method reprojects a squared portion of this raster to another SRS. The number of pixels in the output will be calculated according to the portion being reprojected and the asked resolution.

Parameters
sridThe SRS id of the target SRS.
llxLower-left X-coordinate of the portion to be reprojected (in the original SRS).
llyLower-left Y-coordinate of the portion to be reprojected (in the original SRS).
urxUpper-Right X-coordinate of the portion to be reprojected (in the original SRS).
urlUpper-Right Y-coordinate of the portion to be reprojected (in the original SRS).
resxThe output x resolution (in units of the target SRS).
resxThe output y resolution (in units of the target SRS).
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
mThe method of interpolation to apply (default 1 = nearest neighbor).
See Also
te::rst::Interpolator
Returns
A pointer to the reprojected raster if success and a null pointer otherwise.
Note
The caller will take the ownership of the returned pointer.

Reimplemented in te::gdal::Raster.

Definition at line 560 of file Raster.cpp.

References te::rst::Reproject().

te::rst::Raster * te::rst::Raster::trim ( const te::gm::Envelope env,
const std::map< std::string, std::string > &  rinfo 
)
virtualinherited

Subsetting operation for trimming (cropping) the raster.

Parameters
envThe envelope (inside original extent) to crop the raster.
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
Returns
A pointer to the trimmed raster if success and a null pointer otherwise.
Note
The caller will take the ownership of the returned pointer.

Definition at line 390 of file Raster.cpp.

References te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::rst::RasterFactory::make(), te::rst::Grid::setGeoreference(), te::rst::Grid::setNumberOfColumns(), te::rst::Grid::setNumberOfRows(), te::rst::Raster::setValues(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

Referenced by te::tools::rastermanager::RasterManager::trim().

virtual void te::rst::Raster::vectorize ( std::size_t  ,
std::vector< te::gm::Geometry * > &   
)
inlinevirtualinherited

Vectorizes a given raster band, using GDALPolygonize function.

Parameters
bThe band index to vectorize.
gA reference to a vector of geometries. Will be filled with geometries found in band.

Definition at line 568 of file Raster.h.

Member Data Documentation

std::vector<ExpansibleBand*> te::mem::ExpansibleRaster::m_bands
protected

Internal raster bands.

Definition at line 179 of file ExpansibleRaster.h.

Referenced by ExpansibleRaster().

ExpansibleBandBlocksManager te::mem::ExpansibleRaster::m_blocksManager
protected

Internal blocks manager.

Definition at line 181 of file ExpansibleRaster.h.

Referenced by ExpansibleRaster().

Grid* te::rst::Raster::m_grid
protectedinherited
std::string te::rst::Raster::m_name
protectedinherited

The raster name.

Definition at line 594 of file Raster.h.

Referenced by te::rst::Raster::operator=().

te::common::AccessPolicy te::rst::Raster::m_policy
protectedinherited

The access policy, can be te::common::{NoAccess, RAccess, RWAccess, WAccess}.

Definition at line 596 of file Raster.h.

Referenced by te::idl::IdlRaster::IdlRaster(), and te::gdal::Raster::Raster().


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