te::rst::Raster Class Referenceabstract

An abstract class for raster data strucutures. More...

#include <Raster.h>

Inheritance diagram for te::rst::Raster:
te::dt::AbstractData te::gdal::Raster te::mem::CachedRaster te::mem::ExpansibleRaster te::mem::Raster te::rst::ProxyRaster te::rst::SynchronizedRaster terralib4::Raster

Public Member Functions

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...
 
virtual Rasterclip (const std::vector< te::gm::Geometry const * > geometries, const std::map< std::string, std::string > &rinfo, const std::string &rType) const
 Subsetting operation for clipping the raster. More...
 
virtual AbstractDataclone () const =0
 It returns a clone of this object. More...
 
virtual bool createMultiResolution (const unsigned int levels, const InterpolationMethod interpMethod)=0
 Create a sub-sampled multi-resolution pyramid. More...
 
te::common::AccessPolicy getAccessPolicy () const
 Returns the raster access policy. More...
 
virtual const BandgetBand (std::size_t i) const =0
 Returns the raster i-th band. More...
 
virtual BandgetBand (std::size_t i)=0
 Returns the raster i-th band. More...
 
virtual int getBandDataType (std::size_t i) const =0
 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...
 
GridgetGrid ()
 It returns the raster grid. More...
 
const GridgetGrid () const
 It returns the raster grid. More...
 
virtual std::map< std::string, std::string > getInfo () const =0
 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...
 
virtual RastergetMultiResLevel (const unsigned int level) const =0
 Returns the required level of a multi-resolution pyramid or NULL if that level does not exists. More...
 
virtual unsigned int getMultiResLevelsCount () const =0
 Returns the current number of multi-resolution pyramid levels. More...
 
const std::string & getName () const
 Returns the raster name. More...
 
virtual std::size_t getNumberOfBands () const =0
 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...
 
GridgetResampledGrid (int scale) const
 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...
 
virtual void open (const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)=0
 Opens a raster. More...
 
virtual Rasteroperator*= (Raster &rhs)
 It returns the raster product (pixel by pixel). More...
 
virtual Rasteroperator*= (std::complex< double > &cvalue)
 It returns the product of a constant value to all pixels in the raster. More...
 
virtual Rasteroperator+= (Raster &rhs)
 It returns the raster sum (pixel by pixel). More...
 
virtual Rasteroperator+= (std::complex< double > &cvalue)
 It returns the sum of a constant value to all pixels in the raster. More...
 
virtual Rasteroperator-= (Raster &rhs)
 It returns the raster subtraction (pixel by pixel). More...
 
virtual Rasteroperator-= (std::complex< double > &cvalue)
 It returns the difference from all pixels in the raster to a constant value (pixels - constant). More...
 
virtual Rasteroperator/= (Raster &rhs)
 It returns the raster division (pixel by pixel). More...
 
virtual Rasteroperator/= (std::complex< double > &cvalue)
 It returns the division of all pixels in the raster by a constant value (pixels / constant). More...
 
virtual Rasteroperator= (const Raster &rhs)
 Assignment operator. More...
 
virtual const Bandoperator[] (std::size_t i) const =0
 Access band in i position. More...
 
virtual Bandoperator[] (std::size_t i)=0
 Access band in i position. More...
 
 Raster ()
 Default constructor. More...
 
 Raster (Grid *grid, te::common::AccessPolicy p=te::common::RAccess)
 Constructor to create a raster from parameters. More...
 
 Raster (const Raster &rhs)
 Copy constructor. 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 bool removeMultiResolution ()=0
 Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one. 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) const
 Resample a subset of the raster, given a box. More...
 
virtual Rasterresample (int method, int scale, const std::map< std::string, std::string > &rinfo) const
 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) const
 Subsetting operation for trimming (cropping) the raster. More...
 
virtual void vectorize (std::vector< te::gm::Geometry * > &g, std::size_t b, unsigned int mp=0, std::vector< double > *const polygonsValues=0)
 Vectorizes a given raster band, using GDALPolygonize function. More...
 
virtual ~Raster ()
 Virtual destructor. More...
 

Protected Member Functions

double applyScale (int i, const double &v) const
 Scales a value according to a specific resampling scale. More...
 

Protected Attributes

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

Detailed Description

An abstract class for raster data strucutures.

A raster data structure represents a geograhical area divided into rows and columns, which form a regular grid structure of cells. Each cell contains location co-ordinates and one or more attribute values.

This interface should be implemented by drivers that provide the real access to raster data.

Definition at line 71 of file Raster.h.

Constructor & Destructor Documentation

te::rst::Raster::Raster ( )

Default constructor.

te::rst::Raster::Raster ( Grid grid,
te::common::AccessPolicy  p = te::common::RAccess 
)

Constructor to create a raster from parameters.

Parameters
gridThe grid definition. The Raster will take its ownership.
pAccess Policy.
te::rst::Raster::Raster ( const Raster rhs)

Copy constructor.

Parameters
rhsThe right-hand side Raster.
virtual te::rst::Raster::~Raster ( )
virtual

Virtual destructor.

Reimplemented in te::gdal::Raster, te::mem::Raster, and terralib4::Raster.

Member Function Documentation

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

Scales a value according to a specific resampling scale.

Parameters
iThe scale to apply.
vThe value to be scaled.
Returns
The scaled value.
Raster& te::rst::Raster::callOperator ( std::complex< double >(*)(std::complex< double >, std::complex< double >)  f,
const Raster rhs 
)

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.
virtual Raster* te::rst::Raster::clip ( const std::vector< te::gm::Geometry const * >  geometries,
const std::map< std::string, std::string > &  rinfo,
const std::string &  rType 
) const
virtual

Subsetting operation for clipping the raster.

Parameters
geometriesA vector of pointers to valid geometries.
rinfoThe parameters needed to build the output raster (see RasterFactory documentation).
rTypeThe name of the specific driver to create the raster.
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.
Accepted geometry types: te::gm::Polygon, te::gm::MultiPolygon
virtual bool te::rst::Raster::createMultiResolution ( const unsigned int  levels,
const InterpolationMethod  interpMethod 
)
pure virtual

Create a sub-sampled multi-resolution pyramid.

Parameters
levelsThe number of pyramid levels to generate.
interpMethodThe used interpolation method.
Returns
true if OK, false if errors ocurred.

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

te::common::AccessPolicy te::rst::Raster::getAccessPolicy ( ) const

Returns the raster access policy.

virtual const Band* te::rst::Raster::getBand ( std::size_t  i) const
pure virtual
virtual Band* te::rst::Raster::getBand ( std::size_t  i)
pure virtual

Returns the raster i-th band.

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

Implemented in te::mem::ExpansibleRaster, te::gdal::Raster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

virtual int te::rst::Raster::getBandDataType ( std::size_t  i) const
pure virtual

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

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

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

Returns the geographic extension of the raster data.

Referenced by te::rst::LineIterator< T >::LineIterator(), and te::rst::PointSetIterator< T >::PointSetIterator().

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

Returns the geographic extension of the raster data.

te::gm::Envelope* te::rst::Raster::getExtent ( 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).

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.
const Grid* te::rst::Raster::getGrid ( ) const

It returns the raster grid.

virtual std::map<std::string, std::string> te::rst::Raster::getInfo ( ) const
pure virtual

It returns additional information about the raster.

The return of thi smethod is driver dependent.

Returns
Additional information about the raster.

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

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

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.
virtual Raster* te::rst::Raster::getMultiResLevel ( const unsigned int  level) const
pure virtual

Returns the required level of a multi-resolution pyramid or NULL if that level does not exists.

Parameters
levelLevel of a multi-resolution pyramid.
Returns
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists.
Note
The caller must take the ownership of the returned pointer.

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

virtual unsigned int te::rst::Raster::getMultiResLevelsCount ( ) const
pure virtual

Returns the current number of multi-resolution pyramid levels.

Returns
Returns the current number of multi-resolution pyramid levels.

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

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

Returns the raster name.

virtual std::size_t te::rst::Raster::getNumberOfBands ( ) const
pure virtual

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

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

unsigned int te::rst::Raster::getNumberOfColumns ( ) const
unsigned int te::rst::Raster::getNumberOfRows ( ) const
Grid* te::rst::Raster::getResampledGrid ( int  scale) const

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.
double te::rst::Raster::getResolutionX ( ) const

Returns the raster horizontal (x-axis) resolution.

Referenced by te::rst::LineIterator< T >::LineIterator().

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

Returns the raster vertical (y-axis) resolution.

Referenced by te::rst::LineIterator< T >::LineIterator().

int te::rst::Raster::getSRID ( ) const
int te::rst::Raster::getTypeCode ( ) const
inlinevirtual

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 362 of file Raster.h.

References te::dt::RASTER_TYPE.

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

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.
virtual void te::rst::Raster::getValue ( unsigned int  c,
unsigned int  r,
std::complex< double > &  value,
std::size_t  b = 0 
) const
virtual

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.
virtual void te::rst::Raster::getValues ( unsigned int  c,
unsigned int  r,
std::vector< double > &  values 
) const
virtual

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.
virtual void te::rst::Raster::getValues ( unsigned int  c,
unsigned int  r,
std::vector< std::complex< double > > &  values 
) const
virtual

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.
virtual void te::rst::Raster::open ( const std::map< std::string, std::string > &  rinfo,
te::common::AccessPolicy  p = te::common::RAccess 
)
pure virtual

Opens a raster.

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

Implemented in te::rst::SynchronizedRaster, te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

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

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.
virtual Raster& te::rst::Raster::operator*= ( std::complex< double > &  cvalue)
virtual

It returns the product of a constant value to all pixels in the raster.

Parameters
cvalueThe constant value to be multiplied.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster product.
virtual Raster& te::rst::Raster::operator+= ( Raster rhs)
virtual

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.
virtual Raster& te::rst::Raster::operator+= ( std::complex< double > &  cvalue)
virtual

It returns the sum of a constant value to all pixels in the raster.

Parameters
cvalueThe constant value to be added.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster sum.
virtual Raster& te::rst::Raster::operator-= ( Raster rhs)
virtual

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.
virtual Raster& te::rst::Raster::operator-= ( std::complex< double > &  cvalue)
virtual

It returns the difference from all pixels in the raster to a constant value (pixels - constant).

Parameters
cvalueThe constant value to be subtracted.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster difference.
virtual Raster& te::rst::Raster::operator/= ( Raster rhs)
virtual

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.
virtual Raster& te::rst::Raster::operator/= ( std::complex< double > &  cvalue)
virtual

It returns the division of all pixels in the raster by a constant value (pixels / constant).

Parameters
cvalueThe constant value to be divided.
Note
The caller is responsible to guarantee that resultant values will not exceed the range of the data type.
Returns
The raster division.
virtual Raster& te::rst::Raster::operator= ( const Raster rhs)
virtual

Assignment operator.

Parameters
rhsThe right-hand-side copy that would be used to copy from.
Returns
A reference to this object.
virtual const Band& te::rst::Raster::operator[] ( std::size_t  i) const
pure virtual

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.

Implemented in te::mem::ExpansibleRaster, te::mem::CachedRaster, te::gdal::Raster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

virtual Band& te::rst::Raster::operator[] ( std::size_t  i)
pure virtual

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.

Implemented in te::mem::ExpansibleRaster, te::mem::CachedRaster, te::gdal::Raster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

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

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.
virtual bool te::rst::Raster::removeMultiResolution ( )
pure virtual

Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.

Returns
true if OK, false if errors ocurred.

Implemented in te::gdal::Raster, te::mem::ExpansibleRaster, te::mem::CachedRaster, te::rst::SynchronizedRaster, te::rst::ProxyRaster, te::mem::Raster, and terralib4::Raster.

virtual 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 
) const
virtual

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...
virtual Raster* te::rst::Raster::resample ( int  method,
int  scale,
const std::map< std::string, std::string > &  rinfo 
) const
virtual

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.

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

Sets the raster access policy.

Parameters
pThe new raster access policy.
virtual void te::rst::Raster::setIValue ( unsigned int  c,
unsigned int  r,
const double  value,
std::size_t  b = 0 
)
virtual

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.
void te::rst::Raster::setName ( const std::string  name)

Sets the raster name.

Parameters
nameThe new raster name.
virtual void te::rst::Raster::setValue ( unsigned int  c,
unsigned int  r,
const double  value,
std::size_t  b = 0 
)
virtual

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.
virtual void te::rst::Raster::setValue ( unsigned int  c,
unsigned int  r,
const std::complex< double > &  value,
std::size_t  b = 0 
)
virtual

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.
virtual void te::rst::Raster::setValues ( unsigned int  c,
unsigned int  r,
const std::vector< double > &  values 
)
virtual

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.
virtual void te::rst::Raster::setValues ( unsigned int  c,
unsigned int  r,
const std::vector< std::complex< double > > &  values 
)
virtual

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.
std::string te::rst::Raster::toString ( void  ) const
virtual

It returns the data value in a string notation.

Returns
The data value in a string notation.

Implements te::dt::AbstractData.

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

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

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

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.

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

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.
virtual void te::rst::Raster::vectorize ( std::vector< te::gm::Geometry * > &  g,
std::size_t  b,
unsigned int  mp = 0,
std::vector< double > *const  polygonsValues = 0 
)
virtual

Vectorizes a given raster band, using GDALPolygonize function.

Parameters
gA reference to a vector of geometries. Will be filled with geometries found in band.
bThe band index to vectorize.
polygonsValuesA pointer to a valid vector where the raster pixel values related to each polygon will be stored, or a NULL pointer.
Note
The caller of this method must take the ownership of the returned geometries and must delete them when necessary.

Member Data Documentation

Grid* te::rst::Raster::m_grid
protected

The spatial support for raster data.

Definition at line 699 of file Raster.h.

std::string te::rst::Raster::m_name
protected

The raster name.

Definition at line 698 of file Raster.h.

te::common::AccessPolicy te::rst::Raster::m_policy
protected

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

Definition at line 700 of file Raster.h.


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