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);
531 virtual Raster*
clip(
const std::vector< te::gm::Geometry const *> geometries,
532 const std::map<std::string, std::string>& rinfo,
533 const std::string& rType )
const;
553 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;
568 virtual Raster*
resample(
int method,
int scale,
const std::map<std::string, std::string>& rinfo)
const;
595 virtual Raster*
transform(
int srid,
const std::map<std::string, std::string>& rinfo,
int m = 1)
const;
615 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;
637 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;
650 virtual void vectorize(std::vector<te::gm::Geometry*>& g, std::size_t b,
unsigned int mp = 0, std::vector< double > *
const polygonsValues = 0);
660 virtual void rasterize(std::vector<te::gm::Geometry*> g, std::vector<double> vp, std::size_t b = 0);
702 void setMetaData(
const std::map<std::string, std::string>& metaData );
It implements the vectorizer, based on TerraLib 4 algorithm.
A base class for values that can be retrieved from the data access module.
An Envelope defines a 2D rectangular region.
A raster band description.
A rectified grid is the spatial support for raster data.
An abstract class for raster data strucutures.
int getTypeCode() const
It returns the data type code associated to the data value.
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).
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 setAccessPolicy(te::common::AccessPolicy p)
Sets the raster access policy.
virtual const Band * getBand(std::size_t i) const =0
Returns the raster i-th band.
virtual Raster & operator=(const Raster &rhs)
Assignment operator.
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 Raster * resample(int method, int scale, const std::map< std::string, std::string > &rinfo) const
Resample 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.
virtual ~Raster()
Virtual destructor.
virtual Raster & operator+=(std::complex< double > &cvalue)
It returns the sum of a constant value to all pixels in the raster.
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.
Grid * getResampledGrid(int scale) const
Return the raster grid for a specific scale.
Raster(Grid *grid, te::common::AccessPolicy p=te::common::RAccess)
Constructor to create a raster from parameters.
virtual const Band & operator[](std::size_t i) const =0
Access band in i position.
void setName(const std::string name)
Sets the raster name.
virtual Raster & operator*=(Raster &rhs)
It returns the raster product (pixel by pixel).
std::map< std::string, std::string > m_metaData
Raster metadata in a form [metadada name, metadata value].
Raster(const Raster &rhs)
Copy constructor.
virtual void open(const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess)=0
Opens a raster.
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
std::string toString(void) const
It returns the data value in a string notation.
virtual unsigned int getMultiResLevelsCount() const =0
Returns the current number of multi-resolution pyramid levels.
virtual Raster & operator+=(Raster &rhs)
It returns the raster sum (pixel by pixel).
const Grid * getGrid() const
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 * trim(const te::gm::Envelope *env, const std::map< std::string, std::string > &rinfo, const std::string &rType) const
Subsetting operation for trimming (cropping) the raster.
double getResolutionY() const
Returns the raster vertical (y-axis) resolution.
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 * 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.
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.
virtual Raster & operator/=(std::complex< double > &cvalue)
It returns the division of all pixels in the raster by a constant value (pixels / constant).
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.
Grid * getGrid()
It returns the raster grid.
virtual bool removeMultiResolution()=0
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
int getSRID() const
Returns the raster spatial reference system identifier.
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.
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 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.
unsigned int getNumberOfRows() const
Returns the raster number of rows.
virtual Band & operator[](std::size_t i)=0
Access band in i position.
virtual bool createMultiResolution(const unsigned int levels, const InterpolationMethod interpMethod)=0
Create a sub-sampled multi-resolution pyramid.
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 void rasterize(std::vector< te::gm::Geometry * > g, std::vector< double > vp, std::size_t b=0)
Rasterizes a given vector of geometries.
double getResolutionX() const
Returns the raster horizontal (x-axis) resolution.
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 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::map< std::string, std::string > & getMetaData() const
Returns the current raster metadata in a form [metadada name, metadata value].
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.
virtual Raster * trim(const te::gm::Envelope *env, const std::map< std::string, std::string > &rinfo) const
Subsetting operation for trimming (cropping) the raster.
virtual Band * getBand(std::size_t i)=0
Returns the raster i-th band.
virtual Raster & operator-=(std::complex< double > &cvalue)
It returns the difference from all pixels in the raster to a constant value (pixels - constant).
const te::gm::Envelope * getExtent() const
Returns the geographic extension of the raster data.
Grid * m_grid
The spatial support for raster data.
te::common::AccessPolicy m_policy
The access policy, can be te::common::{NoAccess, RAccess, RWAccess, WAccess}.
Raster()
Default constructor.
virtual Raster & operator-=(Raster &rhs)
It returns the raster subtraction (pixel by pixel).
virtual Raster & operator*=(std::complex< double > &cvalue)
It returns the product of a constant value to all pixels in the raster.
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
void setMetaData(const std::map< std::string, std::string > &metaData)
Sets the raster metadata.
virtual Raster & operator/=(Raster &rhs)
It returns the raster division (pixel by pixel).
double applyScale(int i, const double &v) const
Scales a value according to a specific resampling scale.
std::string m_name
The raster name.
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.
virtual std::map< std::string, std::string > getInfo() const =0
It returns additional information about the raster.
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.
unsigned int getNumberOfColumns() const
Returns the raster number of columns.
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...
const std::string & getName() const
Returns the raster name.
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
AccessPolicy
Supported data access policies (can be used as bitfield).
InterpolationMethod
Allowed interpolation methods.
boost::shared_ptr< Raster > RasterPtr
#define TERASTEREXPORT
You can use this macro in order to export/import classes and functions from this module.
Proxy configuration file for TerraView (see terraview_config.h).