Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Attributes | Private Member Functions
jafar::lgl::GDRasterBand< T > Class Template Reference

traversability raster band, data type in unsigned char (0-255) expressing the trav probability of each raster cell More...


Detailed Description

template<typename T>
class jafar::lgl::GDRasterBand< T >

traversability raster band, data type in unsigned char (0-255) expressing the trav probability of each raster cell

Definition at line 78 of file RasterBand.hpp.

#include <RasterBand.hpp>

Inheritance diagram for jafar::lgl::GDRasterBand< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 GDRasterBand (GDALDataset *_dataset, GDALRasterBand *_band, double _weight=1.0, double _decompositionLimit=8.0, FUSION_METHOD _fmethod=MEAN, HOMOGENEOUS_TYPE _homogType=SIGMA)
 Constructor.
void setGDALRasterBand (GDALRasterBand *_band)
GDALRasterBand * getGDALRasterBand ()
double getWeight ()
int getTypeSize () const
GDALDataType getType () const
int getxroot () const
int getyroot () const
int getxsize () const
 Get band X size in pixels.
int getysize () const
 Get band Y size in pixels.
double getxsize_m () const
 Get band X size in meters according to the dataset resolution.
double getysize_m () const
 Get band Y size in meters according to the dataset resolution.
double getxsize_m (const RasterRect &rect) const
 Get rectangle 'rect' X size in meters according to the dataset resolution.
double getysize_m (const RasterRect &rect) const
 Get rectangle 'rect' Y size in meters according to the dataset resolution.
double getScale () const
void reset (T _v)
 Reset band values to _v.
getValue (const RasterPoint &rpt) const
getValue (int i) const
T * getValuePtr () const
 Returns the values address.
bool getValue (const int &x, const int &y, void *value) const
 Getting value through the GDAL RasterIO function.
get (const RasterCellIndex &cell) const
 Get the value : i = index of the line, j = index of the colums these methods access data in the memory and not from the gdal buffer, this way is faster that the traditional way offered by GDAL.
bool get (const RasterRect &rect, std::vector< T > &v) const
double getDecompositionLimit ()
 Return the value of the quadtree decomposition limit.
void setValue (const RasterCellIndex &cell, T value) const
void setValue (const int index, T value) const
void setScale (double _scale)
void setDecompositionLimit (double _dl)
 Set the value of the quadtree decomposition limit.
bool sameValue (const RasterRect &rect) const
 Returns true when all cells in the raster rect are equals.
bool nearlySameValue (const RasterRect &rect) const
 Returns true when all cells in the raster rect are nearly equals.
bool sigmaSameValue (const RasterRect &rect) const
 Returns true when all cells in the raster rect are nearly equals.
void setProbabilityLag (T newProbaLag)
 Set the probability lag.
void setSigmaFactor (T newSigmaFactor)
 Set the sigma Factor.
getProbabilityLag () const
 Get the probability lag.
getSigmaFactor () const
 Get the probability lag.
double mean (const RasterRect &rect) const
 Calculates the mean value of data in a raster rectangle.
double sd (const RasterRect &rect) const
virtual bool isHomogeneous (const RasterRect &rect) const =0
 Abstract methods from abstract class Raster.
HOMOGENEOUS_TYPE getHomogeneousType () const
 Returns the homogeneity type.
void setHomogeneousType (HOMOGENEOUS_TYPE hhh)
 Set the homogeneity type with an HOMOGENEOUS_TYPE enumeration value.
bool bufferToMem ()
 Buffer the data from the GDAL dataset's band to memory (values) and make the conversion from input.
bool memToBuffer ()
 Writing allocated data (values) to the GDALRasterBand buffer.

Protected Attributes

GDALDataset * dataset
 Main GDAL dataset to which the raster band refers.
int xsize
 X Size of the raster data in the dataset This is the number of pixel on the X Axis.
int ysize
 Y Size of the raster data in the dataset This is the number of pixel on the Y Axis.
double absWEResolution
 Absolute Resolution on West-East axis.
double absNSResolution
 Absolute Resolution on North-South axis.
GDALRasterBand * band
 the gdal raster band containing the data
GDALDataType dataType
 Type of a piece of data in a raster band (int, float...)
double weight
 the weight of the data in the linear combination of global cost value
double decompositionLimit
 Decomposition Limit.
FUSION_METHOD fmethod
 Fusion Method.
T * values
 One dimension Raster Data.
probabilityLag
 Admissible offset around a zone area to consider it nearly homogeneous.
sigmaFactor
 Factor for admissible values in |mean - this_factor * sigma|.
HOMOGENEOUS_TYPE homogType
 Type of homogeneity test that will be done in the isHomogeneous method.

Private Member Functions

 BOOST_STATIC_ASSERT (DataType< T >::value)
 check if T is one of the accepted types by RasterBand

Constructor & Destructor Documentation

template<typename T >
jafar::lgl::GDRasterBand< T >::GDRasterBand ( GDALDataset *  _dataset,
GDALRasterBand *  _band,
double  _weight = 1.0,
double  _decompositionLimit = 8.0,
FUSION_METHOD  _fmethod = MEAN,
HOMOGENEOUS_TYPE  _homogType = SIGMA 
)

Constructor.

Raster band storing information like traversability or landmark, the input file could be of type 8 bit unsigned int or 16 bit unsigned int.

Default decomposition limit is 8.0 meters. Cells larger than this limit will be forced for decomposition.

Parameters:
_datasetGDAL Dataset source of the general information
_bandGDAL Band used to fill the created raster Band
_weightThe ponderation of this band while considering all the bands
_decompositionLimitThe quadtree decomposition limit in meters
_fmethodFusion method when fusin with external data

Definition at line 326 of file RasterBand.hpp.

References jafar::lgl::GDRasterBand< T >::absNSResolution, jafar::lgl::GDRasterBand< T >::absWEResolution, jafar::lgl::GDRasterBand< T >::band, jafar::lgl::GDRasterBand< T >::bufferToMem(), jafar::lgl::GDRasterBand< T >::dataset, jafar::lgl::GDRasterBand< T >::dataType, jafar::lgl::GDRasterBand< T >::setProbabilityLag(), jafar::lgl::GDRasterBand< T >::setSigmaFactor(), jafar::lgl::GDRasterBand< T >::values, jafar::lgl::GDRasterBand< T >::xsize, and jafar::lgl::GDRasterBand< T >::ysize.


Member Function Documentation

template<typename T >
bool jafar::lgl::GDRasterBand< T >::bufferToMem ( )

Buffer the data from the GDAL dataset's band to memory (values) and make the conversion from input.

See also:
bufferToMem
values

Definition at line 377 of file RasterBand.hpp.

Referenced by jafar::lgl::GDRasterBand< T >::GDRasterBand().

template<typename T >
T jafar::lgl::GDRasterBand< T >::getProbabilityLag ( ) const

Get the probability lag.

See also:
probabilityLag

Definition at line 599 of file RasterBand.hpp.

template<typename T >
T jafar::lgl::GDRasterBand< T >::getSigmaFactor ( ) const

Get the probability lag.

See also:
probabilityLag

Definition at line 605 of file RasterBand.hpp.

template<typename T >
bool jafar::lgl::GDRasterBand< T >::getValue ( const int &  x,
const int &  y,
void *  value 
) const

Getting value through the GDAL RasterIO function.

Get Values directly from the GDAL Raster Band. (Slower for seldom values) get method using GDAL access function throught file buffering RasterIO method this is slow comparing to accessing the value directly from the buffered data (values data member) value should be already allocated

Definition at line 543 of file RasterBand.hpp.

template<typename T >
T * jafar::lgl::GDRasterBand< T >::getValuePtr ( ) const

Returns the values address.

Used in memcpy

Definition at line 528 of file RasterBand.hpp.

template<typename T >
double jafar::lgl::GDRasterBand< T >::mean ( const RasterRect rect) const

Calculates the mean value of data in a raster rectangle.

Returns:
mean value of RasterRect& rect's data

Definition at line 794 of file RasterBand.hpp.

References jafar::lgl::RasterRect::size().

template<typename T >
bool jafar::lgl::GDRasterBand< T >::nearlySameValue ( const RasterRect rect) const

Returns true when all cells in the raster rect are nearly equals.

Parameters:
rectdelimited zone to watch
See also:
probabilityLag

Definition at line 635 of file RasterBand.hpp.

References jafar::lgl::RasterRect::xsize(), jafar::lgl::RasterRect::xtopleft, jafar::lgl::RasterRect::ysize(), and jafar::lgl::RasterRect::ytopleft.

template<typename T >
bool jafar::lgl::GDRasterBand< T >::sameValue ( const RasterRect rect) const

Returns true when all cells in the raster rect are equals.

Parameters:
rectdelimited zone to watch

Definition at line 581 of file RasterBand.hpp.

References jafar::lgl::RasterRect::xsize(), jafar::lgl::RasterRect::xtopleft, jafar::lgl::RasterRect::ysize(), and jafar::lgl::RasterRect::ytopleft.

template<typename T>
void jafar::lgl::GDRasterBand< T >::setProbabilityLag ( newProbaLag)

Set the probability lag.

See also:
probabilityLag

Definition at line 623 of file RasterBand.hpp.

Referenced by jafar::lgl::GDRasterBand< T >::GDRasterBand().

template<typename T>
void jafar::lgl::GDRasterBand< T >::setSigmaFactor ( newSigmaFactor)

Set the sigma Factor.

See also:
sigmaFactor sigmaSameValue

Definition at line 629 of file RasterBand.hpp.

Referenced by jafar::lgl::GDRasterBand< T >::GDRasterBand().

template<typename T >
bool jafar::lgl::GDRasterBand< T >::sigmaSameValue ( const RasterRect rect) const

Returns true when all cells in the raster rect are nearly equals.

Parameters:
rectdelimited zone to watch
See also:
sigmaFactor

Definition at line 702 of file RasterBand.hpp.

References jafar::lgl::RasterRect::xsize(), jafar::lgl::RasterRect::xtopleft, jafar::lgl::RasterRect::ysize(), and jafar::lgl::RasterRect::ytopleft.


Member Data Documentation

template<typename T>
double jafar::lgl::GDRasterBand< T >::decompositionLimit [protected]

Decomposition Limit.

During the quadtree decomposition every cells larger than this limit will be decomposed.

Definition at line 273 of file RasterBand.hpp.

template<typename T>
HOMOGENEOUS_TYPE jafar::lgl::GDRasterBand< T >::homogType [protected]

Type of homogeneity test that will be done in the isHomogeneous method.

It can be interpreted differently according to the children class.

Definition at line 312 of file RasterBand.hpp.

template<typename T>
T jafar::lgl::GDRasterBand< T >::probabilityLag [protected]

Admissible offset around a zone area to consider it nearly homogeneous.

Parameter used in the terraing segmentation during the quadtree decomposition

See also:
nearlySameValue

Definition at line 294 of file RasterBand.hpp.

template<typename T>
T jafar::lgl::GDRasterBand< T >::sigmaFactor [protected]

Factor for admissible values in |mean - this_factor * sigma|.

From 0.0 to 3.0 are good values. Less than 0.0 will generate an always-false result (no homogeneity) while values more 3.0 will generate full homogeneity and create partitions with barely identical terrain states. Default is 1.5

See also:
sigmaSameValue setSigmaFactor

Definition at line 306 of file RasterBand.hpp.

template<typename T>
T* jafar::lgl::GDRasterBand< T >::values [protected]

One dimension Raster Data.

2D Raster data is held in this one dimension array by transferring the data line by line (GDALRasterIO)

Because gdal use file IN/OUTPUT buffer and does not really stock all information in the memory, so copy the data to this variables for speeding up the reading and writing speed

Definition at line 287 of file RasterBand.hpp.

Referenced by jafar::lgl::GDRasterBand< T >::GDRasterBand().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:42 for Jafar by doxygen 1.7.6.1
LAAS-CNRS