Go to the documentation of this file.
26 #ifndef __TERRALIB_RASTER_INTERNAL_RASTER_H
27 #define __TERRALIB_RASTER_INTERNAL_RASTER_H
30 #include "../common/Enums.h"
31 #include "../datatype/AbstractData.h"
32 #include "../datatype/Enums.h"
33 #include "../geometry/Geometry.h"
44 #include <boost/shared_ptr.hpp>
49 namespace gm {
class Envelope; }
131 virtual std::map<std::string, std::string>
getInfo()
const = 0;
238 virtual void getValue(
unsigned int c,
unsigned int r,
double& value, std::size_t b = 0)
const;
252 virtual void setValue(
unsigned int c,
unsigned int r,
const double value, std::size_t b = 0);
266 virtual void getIValue(
unsigned int c,
unsigned int r,
double& value, std::size_t b = 0)
const;
280 virtual void setIValue(
unsigned int c,
unsigned int r,
const double value, std::size_t b = 0);
294 virtual void getValue(
unsigned int c,
unsigned int r, std::complex<double>& value, std::size_t b = 0)
const;
308 virtual void setValue(
unsigned int c,
unsigned int r,
const std::complex<double>& value, std::size_t b = 0);
321 virtual void getValues(
unsigned int c,
unsigned int r, std::vector<double>& values)
const;
334 virtual void getValues(
unsigned int c,
unsigned int r, std::vector<std::complex<double> >& values)
const;
347 virtual void setValues(
unsigned int c,
unsigned int r,
const std::vector<double>& values);
360 virtual void setValues(
unsigned int c,
unsigned int r,
const std::vector<std::complex<double> >& values);
518 virtual Raster*
clip(
const std::vector< te::gm::Geometry const *> geometries,
519 const std::map<std::string, std::string>& rinfo,
520 const std::string& rType )
const;
540 virtual 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;
555 virtual Raster*
resample(
int method,
int scale,
const std::map<std::string, std::string>& rinfo)
const;
582 virtual Raster*
transform(
int srid,
const std::map<std::string, std::string>& rinfo,
int m = 1)
const;
602 virtual Raster*
transform(
int srid,
double llx,
double lly,
double urx,
double ury,
const std::map<std::string, std::string>& rinfo,
int m = 1)
const;
624 virtual 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;
637 virtual void vectorize(std::vector<te::gm::Geometry*>& g, std::size_t b,
unsigned int mp = 0, std::vector< double > *
const polygonsValues = 0);
647 virtual void rasterize(std::vector<te::gm::Geometry*> g, std::vector<double> vp, std::size_t b = 0);
708 #endif //__TERRALIB_RASTER_INTERNAL_RASTER_H
virtual Raster * resample(int method, int scale, const std::map< std::string, std::string > &rinfo) const
Resample raster.
virtual Raster * getMultiResLevel(const unsigned int level) const =0
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists.
An Envelope defines a 2D rectangular region.
virtual void open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)=0
Opens a raster.
Grid * getGrid()
It returns the raster grid.
virtual int getBandDataType(std::size_t i) const =0
Returns the data type in a particular band (or dimension).
virtual Raster & operator+=(std::complex< double > &cvalue)
It returns the sum of a constant value to all pixels in the raster.
A raster band description.
double applyScale(int i, const double &v) const
Scales a value according to a specific resampling scale.
int getSRID() const
Returns the raster spatial reference system identifier.
virtual bool removeMultiResolution()=0
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
virtual Raster & operator-=(std::complex< double > &cvalue)
It returns the difference from all pixels in the raster to a constant value (pixels - constant).
virtual Raster & operator/=(std::complex< double > &cvalue)
It returns the division of all pixels in the raster by a constant value (pixels / constant).
Raster()
Default constructor.
virtual Raster * trim(const te::gm::Envelope *env, const std::map< std::string, std::string > &rinfo) const
Subsetting operation for trimming (cropping) the raster.
An abstract class for raster data strucutures.
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.
void setName(const std::string name)
Sets the raster name.
virtual Raster * clip(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.
std::string m_name
The raster name.
virtual Raster * transform(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 porti...
virtual Raster * transform(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....
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
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.
virtual Raster & operator=(const Raster &rhs)
Assignment operator.
virtual ~Raster()
Virtual destructor.
Raster & callOperator(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,...
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.
const std::string & getName() const
Returns the raster name.
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.
A rectified grid is the spatial support for raster data.
#define TERASTEREXPORT
You can use this macro in order to export/import classes and functions from this module.
virtual Raster & operator*=(std::complex< double > &cvalue)
It returns the product of a constant value to all pixels in the raster.
Grid * getResampledGrid(int scale) const
Return the raster grid for a specific scale.
virtual unsigned int getMultiResLevelsCount() const =0
Returns the current number of multi-resolution pyramid levels.
virtual Band & operator[](std::size_t i)=0
Access band in i position.
const Grid * getGrid() const
It returns the raster grid.
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
int getTypeCode() const
It returns the data type code associated to the data value.
InterpolationMethod
Allowed interpolation methods.
virtual std::map< std::string, std::string > getInfo() const =0
It returns additional information about the raster.
virtual Raster & operator/=(Raster &rhs)
It returns the raster division (pixel by pixel).
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.
const te::gm::Envelope * getExtent() const
Returns the geographic extension of the raster data.
te::common::AccessPolicy m_policy
The access policy, can be te::common::{NoAccess, RAccess, RWAccess, WAccess}.
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.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
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.
boost::shared_ptr< Raster > RasterPtr
Raster(Grid *grid, te::common::AccessPolicy p=te::common::RAccess)
Constructor to create a raster from parameters.
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.
virtual Raster & operator+=(Raster &rhs)
It returns the raster sum (pixel by pixel).
virtual Raster & operator-=(Raster &rhs)
It returns the raster subtraction (pixel by pixel).
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.
double getResolutionX() const
Returns the raster horizontal (x-axis) resolution.
te::gm::Envelope * 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).
Grid * m_grid
The spatial support for raster data.
A base class for values that can be retrieved from the data access module.
virtual bool createMultiResolution(const unsigned int levels, const InterpolationMethod interpMethod)=0
Create a sub-sampled multi-resolution pyramid.
void setAccessPolicy(te::common::AccessPolicy p)
Sets the raster access policy.
Proxy configuration file for TerraView (see terraview_config.h).
std::string toString(void) const
It returns the data value in a string notation.
double getResolutionY() const
Returns the raster vertical (y-axis) resolution.
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
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.
virtual Raster & operator*=(Raster &rhs)
It returns the raster product (pixel by pixel).
Raster(const Raster &rhs)
Copy constructor.
virtual Band * getBand(std::size_t i)=0
Returns the raster i-th band.
It implements the vectorizer, based on TerraLib 4 algorithm.
virtual 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
Resample a subset of the raster, given a box.
virtual 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
Reprojects a squared portion of this raster to another SRS with a desired resolution.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
AccessPolicy
Supported data access policies (can be used as bitfield).
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.
virtual const Band & operator[](std::size_t i) const =0
Access band in i position.
virtual void rasterize(std::vector< te::gm::Geometry * > g, std::vector< double > vp, std::size_t b=0)
Rasterizes a given vector of geometries.