An adapter class to allow concurrent access to raster data by multiple threads. More...
#include <SynchronizedRaster.h>
  
 Public Member Functions | |
| 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, rhs);.  More... | |
| 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.  More... | |
| te::dt::AbstractData * | clone () const | 
| It returns a clone of this object.  More... | |
| bool | createMultiResolution (const unsigned int levels, const InterpolationMethod interpMethod) | 
| Create a sub-sampled multi-resolution pyramid.  More... | |
| te::common::AccessPolicy | getAccessPolicy () const | 
| Returns the raster access policy.  More... | |
| const te::rst::Band * | getBand (std::size_t i) const | 
| Returns the raster i-th band.  More... | |
| te::rst::Band * | getBand (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::Envelope * | getExtent () | 
| Returns the geographic extension of the raster data.  More... | |
| const te::gm::Envelope * | getExtent () const | 
| Returns the geographic extension of the raster data.  More... | |
| 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).  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... | |
| Raster * | getMultiResLevel (const unsigned int level) const | 
| Returns the required level of a multi-resolution pyramid or NULL if that level does not exists.  More... | |
| unsigned int | getMultiResLevelsCount () const | 
| Returns the current number of multi-resolution pyramid levels.  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) 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 Raster & | operator*= (Raster &rhs) | 
| It returns the raster product (pixel by pixel).  More... | |
| virtual Raster & | operator*= (std::complex< double > &cvalue) | 
| It returns the product of a constant value to all pixels in the raster.  More... | |
| virtual Raster & | operator+= (Raster &rhs) | 
| It returns the raster sum (pixel by pixel).  More... | |
| virtual Raster & | operator+= (std::complex< double > &cvalue) | 
| It returns the sum of a constant value to all pixels in the raster.  More... | |
| virtual Raster & | operator-= (Raster &rhs) | 
| It returns the raster subtraction (pixel by pixel).  More... | |
| virtual Raster & | operator-= (std::complex< double > &cvalue) | 
| It returns the difference from all pixels in the raster to a constant value (pixels - constant).  More... | |
| virtual Raster & | operator/= (Raster &rhs) | 
| It returns the raster division (pixel by pixel).  More... | |
| virtual Raster & | operator/= (std::complex< double > &cvalue) | 
| It returns the division of all pixels in the raster by a constant value (pixels / constant).  More... | |
| const te::rst::Band & | operator[] (std::size_t i) const | 
| Access band in i position.  More... | |
| te::rst::Band & | operator[] (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... | |
| bool | removeMultiResolution () | 
| Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.  More... | |
| 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.  More... | |
| virtual Raster * | resample (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... | |
| SynchronizedRaster (RasterSynchronizer &sync, const unsigned char maxMemPercentUsed) | |
| Constructor.  More... | |
| SynchronizedRaster (const unsigned int maxNumberOfCacheBlocks, RasterSynchronizer &sync) | |
| Constructor.  More... | |
| std::string | toString (void) const | 
| It returns the data value in a string notation.  More... | |
| 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. The output resolution is calculated in order to maintain the same number of pixels as in this raster.  More... | |
| 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 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 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.  More... | |
| virtual Raster * | trim (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... | |
| ~SynchronizedRaster () | |
Protected Member Functions | |
| double | applyScale (int i, const double &v) const | 
| Scales a value according to a specific resampling scale.  More... | |
| void | free () | 
| Free all allocated internal resources and go back to the initial state.  More... | |
Protected Attributes | |
| std::vector< SynchronizedBand * > | m_bands | 
| Internal raster bands.  More... | |
| SynchronizedBandBlocksManager | 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 | |
| void | open (const std::map< std::string, std::string > &rinfo, te::common::AccessPolicy p=te::common::RAccess) | 
| Opens a raster.  More... | |
| SynchronizedRaster () | |
| SynchronizedRaster (te::rst::Grid *grid, te::common::AccessPolicy p=te::common::RAccess) | |
An adapter class to allow concurrent access to raster data by multiple threads.
Definition at line 51 of file SynchronizedRaster.h.
| te::rst::SynchronizedRaster::SynchronizedRaster | ( | RasterSynchronizer & | sync, | 
| const unsigned char | maxMemPercentUsed | ||
| ) | 
Constructor.
| sync | The raster synchronizer instance. | 
| maxMemPercentUsed | The maximum free memory percentual to use valid range: [1:100]. | 
| te::rst::SynchronizedRaster::SynchronizedRaster | ( | const unsigned int | maxNumberOfCacheBlocks, | 
| RasterSynchronizer & | sync | ||
| ) | 
Constructor.
| sync | The raster synchronizer instance. | 
| maxNumberOfCacheBlocks | The maximum number of cache blocks. | 
| te::rst::SynchronizedRaster::~SynchronizedRaster | ( | ) | 
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  protectedinherited | 
Scales a value according to a specific resampling scale.
| i | The scale to apply. | 
| v | The value to be scaled. | 
      
  | 
  inherited | 
It calls a parameter function f to apply in all pixels from two rasters, e.g. pixel = f(lhs, rhs);.
| (*f) | a function with the signature complex<double>(*f)(complex<double>, complex<double>), const Raster& rhs) | 
| rhs | The rhs raster to apply the function. | 
      
  | 
  virtualinherited | 
Subsetting operation for clipping the raster.
| geometries | A vector of pointers to valid geometries. | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
| rType | The name of the specific driver to create the raster. | 
      
  | 
  virtual | 
      
  | 
  inlinevirtual | 
Create a sub-sampled multi-resolution pyramid.
| levels | The number of pyramid levels to generate. | 
| interpMethod | The used interpolation method. | 
Implements te::rst::Raster.
Definition at line 114 of file SynchronizedRaster.h.
      
  | 
  protected | 
Free all allocated internal resources and go back to the initial state.
      
  | 
  inherited | 
Returns the raster access policy.
      
  | 
  inlinevirtual | 
Returns the raster i-th band.
| i | The band index. | 
Implements te::rst::Raster.
Definition at line 88 of file SynchronizedRaster.h.
      
  | 
  inlinevirtual | 
Returns the raster i-th band.
| i | The band index. | 
Implements te::rst::Raster.
Definition at line 94 of file SynchronizedRaster.h.
      
  | 
  virtual | 
Returns the data type in a particular band (or dimension).
| i | The desired band. | 
Implements te::rst::Raster.
      
  | 
  inherited | 
Returns the geographic extension of the raster data.
Referenced by te::rst::LineIterator< T >::LineIterator(), and te::rst::PointSetIterator< T >::PointSetIterator().
      
  | 
  inherited | 
Returns the geographic extension of the raster data.
      
  | 
  inherited | 
Returns the geographic extension of the raster data, in a given SRS (distinct from its original one).
| srid | The target SRS id. | 
| roi | Pointer to a region of interest. If NULL the original extenstion will be considered. | 
      
  | 
  inherited | 
It returns the raster grid.
Referenced by te::rst::LineIterator< T >::LineIterator(), te::rst::PointSetIterator< T >::PointSetIterator(), and te::rst::PolygonIterator< T >::PolygonIterator().
      
  | 
  inherited | 
It returns the raster grid.
      
  | 
  virtual | 
It returns additional information about the raster.
The return of thi smethod is driver dependent.
Implements te::rst::Raster.
      
  | 
  virtualinherited | 
Returns the imaginary attribute value in a complex band of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| value | The attribute value to be assigned. | 
| b | A particular band of the cell attribute. Default value 0. | 
| Exception | Subclasses may throw an exception if the data value can not be read. | 
      
  | 
  inlinevirtual | 
Returns the required level of a multi-resolution pyramid or NULL if that level does not exists.
| level | Level of a multi-resolution pyramid. | 
Implements te::rst::Raster.
Definition at line 126 of file SynchronizedRaster.h.
      
  | 
  inlinevirtual | 
Returns the current number of multi-resolution pyramid levels.
Implements te::rst::Raster.
Definition at line 121 of file SynchronizedRaster.h.
      
  | 
  inherited | 
Returns the raster name.
      
  | 
  inlinevirtual | 
Returns the number of bands (dimension of cells attribute values) in the raster.
Implements te::rst::Raster.
Definition at line 81 of file SynchronizedRaster.h.
      
  | 
  inherited | 
Returns the raster number of columns.
Referenced by te::rst::AbstractBandIterator< T >::AbstractBandIterator(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWithMask< T >::BandIteratorWithMask().
      
  | 
  inherited | 
Returns the raster number of rows.
Referenced by te::rst::AbstractBandIterator< T >::AbstractBandIterator(), te::rst::BandIteratorWindow< T >::BandIteratorWindow(), and te::rst::BandIteratorWithMask< T >::BandIteratorWithMask().
      
  | 
  inherited | 
Return the raster grid for a specific scale.
| scale | The desired sacale of interpolation (use - to shrink or + to enlarge). | 
      
  | 
  inherited | 
Returns the raster horizontal (x-axis) resolution.
Referenced by te::rst::LineIterator< T >::LineIterator().
      
  | 
  inherited | 
Returns the raster vertical (y-axis) resolution.
Referenced by te::rst::LineIterator< T >::LineIterator().
      
  | 
  inherited | 
Returns the raster spatial reference system identifier.
Referenced by te::rst::LineIterator< T >::LineIterator(), te::rst::PointSetIterator< T >::PointSetIterator(), and te::rst::PolygonIterator< T >::PolygonIterator().
      
  | 
  inlinevirtualinherited | 
It 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.
      
  | 
  virtualinherited | 
Returns the attribute value of a band of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| value | To return the attribute value. | 
| b | A particular band of the cell attribute. | 
| Exception | Subclasses may throw an exception if the data value can not be read. | 
      
  | 
  virtualinherited | 
Returns the imaginary attribute value in a complex band of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| value | The complex attribute value to be assigned (real, imaginary). | 
| b | A particular band of the cell attribute. Default value 0. | 
| Exception | Subclasses may throw an exception if the data value can not be read. | 
      
  | 
  virtualinherited | 
Returns the imaginary attribute values in all complex bands of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| values | A vector of attribute values to be assigned (not complex values). | 
| Exception | Subclasses may throw an exception if the data value can not be read. | 
      
  | 
  virtualinherited | 
Returns the imaginary attribute values in all complex bands of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| values | A vector of complex attribute values to be assigned (real, imaginary). | 
| Exception | Subclasses may throw an exception if the data value can not be read. | 
      
  | 
  privatevirtual | 
Opens a raster.
| rinfo | The information needed by each driver to open the raster. | 
| p | Access Policy. | 
Implements te::rst::Raster.
It returns the raster product (pixel by pixel).
| rhs | The raster to be multiplied, right-hand side. | 
      
  | 
  virtualinherited | 
It returns the product of a constant value to all pixels in the raster.
| cvalue | The constant value to be multiplied. | 
It returns the raster sum (pixel by pixel).
| rhs | The raster to be added, right-hand side. | 
      
  | 
  virtualinherited | 
It returns the sum of a constant value to all pixels in the raster.
| cvalue | The constant value to be added. | 
It returns the raster subtraction (pixel by pixel).
| rhs | The raster to be subtracted, right-hand side. | 
      
  | 
  virtualinherited | 
It returns the difference from all pixels in the raster to a constant value (pixels - constant).
| cvalue | The constant value to be subtracted. | 
It returns the raster division (pixel by pixel).
| rhs | The raster to be divided, right-hand side. | 
      
  | 
  virtualinherited | 
It returns the division of all pixels in the raster by a constant value (pixels / constant).
| cvalue | The constant value to be divided. | 
      
  | 
  inlinevirtual | 
Access band in i position.
| i | The band index. | 
Implements te::rst::Raster.
Definition at line 100 of file SynchronizedRaster.h.
      
  | 
  inlinevirtual | 
Access band in i position.
| i | The band index. | 
Implements te::rst::Raster.
Definition at line 106 of file SynchronizedRaster.h.
      
  | 
  virtualinherited | 
Rasterizes a given vector of geometries.
| g | A vector of geometries to be rasterized. | 
| vp | A vector of pixel values for each geometry. Can have the same size of the vector of geometries, or be null. | 
| b | The band index to rasterize. | 
      
  | 
  inlinevirtual | 
Remove/Destroy a sub-sampled multi-resolution pyramid, if there is one.
Implements te::rst::Raster.
Definition at line 119 of file SynchronizedRaster.h.
      
  | 
  virtualinherited | 
Resample a subset of the raster, given a box.
| method | The method of interpolation. | 
| drow | The starting row to make a subset of the image. | 
| dcolumn | The starting column to make a subset of the image. | 
| height | The height of the subset. | 
| width | The width of the subset. | 
| newheight | The resampled height of the new raster. | 
| newwidth | The resampled width of the new raster. | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
      
  | 
  virtualinherited | 
Resample raster.
| method | The method of interpolation. | 
| scale | The scale of interpolation (use - to shrink or + to enlarge). | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
Reimplemented in te::gdal::Raster.
      
  | 
  inherited | 
Sets the raster access policy.
| p | The new raster access policy. | 
      
  | 
  virtualinherited | 
Sets the imaginary attribute value in a complex band of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| value | The attribute value to be assigned. | 
| b | A particular band of the cell attribute. Default value 0. | 
| Exception | Subclasses may throw an exception if the data value can not be write. | 
      
  | 
  inherited | 
Sets the raster name.
| name | The new raster name. | 
      
  | 
  virtualinherited | 
Sets the attribute value in a band of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| value | The attribute value to be assigned. | 
| b | A particular band of the cell attribute. | 
| Exception | Subclasses may throw an exception if the data value can not be write. | 
      
  | 
  virtualinherited | 
Sets the imaginary attribute value in a complex band of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| value | The complex attribute value to be assigned (real, imaginary). | 
| b | A particular band of the cell attribute. Default value 0. | 
| Exception | Subclasses may throw an exception if the data value can not be write. | 
      
  | 
  virtualinherited | 
Sets the imaginary attribute values in all complex bands of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| values | A vector of attribute values to be assigned (not complex values). | 
| Exception | Subclasses may throw an exception if the data value can not be write. | 
      
  | 
  virtualinherited | 
Sets the imaginary attribute values in all complex bands of a cell.
| c | The column location of the cell. | 
| r | The row location of the cell. | 
| values | A vector of complex attribute values to be assigned (real, imaginary). | 
| Exception | Subclasses may throw an exception if the data value can not be write. | 
      
  | 
  virtualinherited | 
It returns the data value in a string notation.
Implements te::dt::AbstractData.
      
  | 
  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.
| srid | The target SRS identifier. | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
| m | The method of interpolation to apply (default 1 = nearest neighbor). | 
      
  | 
  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.
| srid | The target SRS identifier. | 
| llx | Lower-left X-coordinate of the portion to be reprojected (in the original SRS). | 
| lly | Lower-left Y-coordinate of the portion to be reprojected (in the original SRS). | 
| urx | Upper-Right X-coordinate of the portion to be reprojected (in the original SRS). | 
| url | Upper-Right Y-coordinate of the portion to be reprojected (in the original SRS). | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
| m | The method of interpolation to apply (default 1 = nearest neighbor). | 
      
  | 
  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.
| srid | The SRS id of the target SRS. | 
| llx | Lower-left X-coordinate of the portion to be reprojected (in the original SRS). | 
| lly | Lower-left Y-coordinate of the portion to be reprojected (in the original SRS). | 
| urx | Upper-Right X-coordinate of the portion to be reprojected (in the original SRS). | 
| url | Upper-Right Y-coordinate of the portion to be reprojected (in the original SRS). | 
| resx | The output x resolution (in units of the target SRS). | 
| resx | The output y resolution (in units of the target SRS). | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
| m | The method of interpolation to apply (default 1 = nearest neighbor). | 
Reimplemented in te::gdal::Raster.
      
  | 
  virtualinherited | 
Subsetting operation for trimming (cropping) the raster.
| env | The envelope (inside original extent) to crop the raster. | 
| rinfo | The parameters needed to build the output raster (see RasterFactory documentation). | 
      
  | 
  virtualinherited | 
Vectorizes a given raster band, using GDALPolygonize function.
| g | A reference to a vector of geometries. Will be filled with geometries found in band. | 
| b | The band index to vectorize. | 
| polygonsValues | A pointer to a valid vector where the raster pixel values related to each polygon will be stored, or a NULL pointer. | 
      
  | 
  protected | 
Internal raster bands.
Definition at line 148 of file SynchronizedRaster.h.
      
  | 
  protected | 
Internal blocks manager.
Definition at line 146 of file SynchronizedRaster.h.
      
  | 
  protectedinherited | 
      
  | 
  protectedinherited | 
      
  | 
  protectedinherited | 
The access policy, can be te::common::{NoAccess, RAccess, RWAccess, WAccess}.