Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends
jafar::gramer::GeoData Class Reference

Class for GDAL data handling. More...


Detailed Description

Class for GDAL data handling.

Definition at line 170 of file GeoData.hpp.

#include <GeoData.hpp>

List of all members.

Classes

struct  BandDefinition
 Definition of a band. More...

Public Types

typedef struct
jafar::gramer::GeoData::BandDefinition 
BandDefinition
 Definition of a band.

Public Member Functions

 GeoData ()
 Default Constructor with no image or data load.
 GeoData (const std::string &_conffilename, FUSION_METHOD _fmethod=FUSION_MEAN)
 Creates a GeoData object from a geodata configuration file.
 ~GeoData ()
 Constructor used to load a map from buffered data.
bool loadBand (BandDefinition band, const std::string &_dsfilename)
bool loadConfigurationFile (const std::string &conffile)
 Load the GRAMER configuration file.
GDALDataset * getDataset () const
 Return the pointer to the main root dataset.
void getAffineTransform (double &_utmXRoot, double &_utmYRoot, double &_cellXRes, double &_cellYRes)
 Get the affine transformation parameters.
int getxsize () const
 Methods to read the root raster cell.
int getysize () const
double getScale () const
 Return the geodata scale.
double geoxroot () const
 Geographical X coordinate of the top left corner.
double geoyroot () const
 Geographical Y coordinate of the top left corner.
double geoxend () const
 Geographical X coordinate of the down right corner.
double geoyend () const
 Geographical Y coordinate of the down right corner.
double geoxres () const
 Geographical X resolution of raster pixels.
double geoyres () const
 Geographical Y resolution of raster pixels.
double getSigmaFactor ()
 Get the sigma factor used while the decomposition type is SIGMA.
double getProbabilityLag ()
 Get the probabilityLag.
bool getValueFromBand (BandDefinition _aband, int xindex, int yindex, double &readValue)
 Get the value loaded from the band _aband at given index.
double getData (const RasterCell &rect) const
double getData (const BandDefinition &bandDef, const RasterCell &rect) const
void setScale (double _scale)
 Set the GDAL dataset scale.
void setFusingMethod (FUSION_METHOD _fmethod)
 Set/Updates the value in band _aband at index _index using _val as the new value.
void setDecompositionLimit (double _dl)
 bool setData(double* bufferedData, double* bufferedOther, int _xsize, int _ysize, int _band = GEODATA_TFLAT_BAND);
void setDecompositionType (HOMOGENEOUS_TYPE ht_)
 Set decomposition type for all bands.
void setProbabilityLag (double probaLag_)
 Set the probability lag used when the decomposition type is NEARLY.
void setSigmaFactor (double sigmaF_)
 Set the sigmaf factor used while the decomposition type is SIGMA.
void setSimulationProbaVisionLimit (double spvl_)
 Set the simulationProbaVisionLimit factor.
bool isHomogeneous (const RasterCell &rect) const
 given a rect ((top,left),(right,bottom)), tell if this is homogeneous
bool overlaps (GeoData *_toMerge)
 Verify if geodata is overlapping at least with 1 pixel with _toMerge geodata.
bool loadData (const std::string &_dsfilename)
 Method to load an image or use an existing dataset.
bool setBandTag (int iband, BandDefinition &bandDef)
 Set a Band tag in the GeoData relation table (map)
bool addBandToDataset (BandDefinition &inputinfo)
 Add a layer of information to the GDAL Dataset.
void addDataset (GDALDataset *_dataset)
 Add information to the GDAL Dataset.
void printInfo (bool verbose=true) const
 Merge with another geodata.
bool saveData (const std::string &outfile, const char *wFormat="GTIFF")
 Saving images in GeoTif format by default.
void resetBands ()
 Saving only traversability layer in a ppm file.
bool saveUtility (const std::string &outfile)
 Write a ppm image of the utility map : mapUtility.
bool saveEntropy (const std::string &outfile)
 Write a ppm image of the entropy map : mapH.
bool savePotential (const std::string &outfile)
 Write a ppm image of the potential map : mapPotential.
double euclideanDistance (double, double, double, double)
 Returns the planar euclidean distances between two points.
bool setUTMProjection (GDALDataset *inputDataset, int utmZone)
double getSimulationProbaVisionLimit ()
 Get the probability lag used for decomposition in the traversability band.

Static Public Member Functions

static const double DEFAULT_DATA_VALUE ()
static const double GEODATA_DEFAULT_SCALE ()

Public Attributes

int isInVirtualMemory
 Virtual file detection flag.

Private Member Functions

void info (std::ostream &info, bool verbose=true) const
 Prints information about the GDal Dataset This method is called in the redifinition of operator "<<".

Private Attributes

std::string conffilename
 Configuration file name.
std::string dsfilename
 Loaded file name.
GDALDataset * dataset
 GDALDataset of the loaded image or any other GDAL Compatible file This holds every possible information about it.
double refGeoTransform [6]
 Coefficient of affine Geo reference transformation array: [0] : X origin of left top corner of left top pixel [3] : Y origin of ...
CPLErr refGeoTransformRType
 Return type of dataset->GetGeoTransform() function that fills the refGeoTransform array.
RasterCell rootCell
 Master root raster cell that holds size information.
FUSION_METHOD fmethod
 Default data fusion method for different uses.
HOMOGENEOUS_TYPE htype
 Homogeneity type to use during map decomposition.
double decompositionLimit
 Quadtree maximum cell size in meter.
double sigmaFactor
 Sigma factor to use for decomposition.
double probabilityLag
 Admissible offset around a zone area to consider it nearly homogeneous.
double simulationProbaVisionLimit
 Limit used to evaluate intervisibility on real worlds since on simulated world everything is fully state-defined.
std::vector< BandDefinitiongeoBands
 Map the users' tags to their respective band number.

Friends

std::ostream & operator<< (std::ostream &out, const GeoData &gd)
 Redefinition of operator <<.

Constructor & Destructor Documentation

jafar::gramer::GeoData::GeoData ( const std::string &  _conffilename,
FUSION_METHOD  _fmethod = FUSION_MEAN 
)

Creates a GeoData object from a geodata configuration file.

Parameters:
_conffilenameFile Path for a geodata configuration file.
_fmethodFusion method enum value

Constructor used to load a map from buffered data.

Destructor


Member Function Documentation

Add a layer of information to the GDAL Dataset.

Parameters:
inputinfoband information to load in memory
See also:
setBandTag()
void jafar::gramer::GeoData::addDataset ( GDALDataset *  _dataset)

Add information to the GDAL Dataset.

Parameters:
_datasetGDAL Dataset to fuse
See also:
mergeStrict()

Get the probabilityLag.

See also:
probabilityLag

Get the sigma factor used while the decomposition type is SIGMA.

See also:
sigmaFactor

Get the probability lag used for decomposition in the traversability band.

Get the probability lag used for decomposition in the rough terrain band Get the sigma used for decomposition in the traversability band Get the sigma used for decomposition in the rough terrain band Get the simulationProbaVisionLimit factor

bool jafar::gramer::GeoData::getValueFromBand ( BandDefinition  _aband,
int  xindex,
int  yindex,
double &  readValue 
)

Get the value loaded from the band _aband at given index.

Get the value loaded from the band _aband at given x and y coordinates of the top left pixel corner

bool jafar::gramer::GeoData::loadConfigurationFile ( const std::string &  conffile)

Load the GRAMER configuration file.

Load an ASCII file to get user band names and corresponding file names. It may include more parameters.

Format to be respected:

PREFIXED_BAND_NAME filename band_number

  • The dash "-" has to be used when the user wants to ignore the parameter and let GRAMER set the default value.
  • The prefix for the band name must be taken from the list of bandPrefixDictionnary array.
Parameters:
conffileConfiguration file path
See also:
bandPrefixDictionnary setBandTag
bool jafar::gramer::GeoData::loadData ( const std::string &  _dsfilename)

Method to load an image or use an existing dataset.

When loading GeoData from a file the file should at least contains one band of information or contain 3 channels.

  • 8-Bit One band images are greyscale images: The band is used as the traversability band and obstacle value is completarily deducted.
  • RGB images : Red channel is not used Green Channel is used for flat terrain probability (traversabilityBand) Blue Channel is used of rough terrain probability (roughTerrainBand) The obstacle probability is then complementarily deducted.
Parameters:
_dsfilenameFile path of the file to open
_useThisDatasetIf not NULL Take precedence on _dsfilename
Returns:
true When the file could be processed (else false).

Verify if geodata is overlapping at least with 1 pixel with _toMerge geodata.

Returns:
true if overlapping
void jafar::gramer::GeoData::printInfo ( bool  verbose = true) const

Merge with another geodata.

The Common overlapping region is calculated and the fusing method is called on this region. The data is fused in "this" and its size is not changed so there is merging only if "this" overlaps with "_toMerge". Fusion is made according to the choosen fusion method (fmethod)

Parameters:
_toMergeGeoData to merge with the current data
_abandThe band that is to be merged
See also:
fmethod Fusing information from the fusingRect region from _geodata into innerRect region of the current geodata. In this method we consider that the fusingRect is always strictly included in the boundaries of the current GeoData and is equal in real geographic region to the one defined by innerRect
Parameters:
_geodataGeoData to fuse with.
_abandBand number to fuse.
innerRectZone in which data have to be fused
fusingRectZone from which data will be fused Print useful information on the loaded geo data

Saving only traversability layer in a ppm file.

Reset knowledge on all layers

bool jafar::gramer::GeoData::setBandTag ( int  iband,
BandDefinition bandDef 
)

Set a Band tag in the GeoData relation table (map)

See also:
addBandToDataset()

bool setData(double* bufferedData, double* bufferedOther, int _xsize, int _ysize, int _band = GEODATA_TFLAT_BAND);

Write attributes in cell covering position (at_i, at_j)

It can be called with internalTransfer = false in order to avoid multiple calls of memToBuffer in case setData is used in a loop. This greatly fasten the process.

Parameters:
at_ii coordinate of the set pixel.
at_jj coordinate of the set pixel.
inattAttributes, information input to set.
internalTransferDefault is true to enable the memToBuffer transfer. Modifies the decomposition limit on all bands
void jafar::gramer::GeoData::setFusingMethod ( FUSION_METHOD  _fmethod)

Set/Updates the value in band _aband at index _index using _val as the new value.

Set the fusing method to an available fusing flag

See also:
fmethod

Member Data Documentation

FUSION_METHOD jafar::gramer::GeoData::fmethod [private]

Default data fusion method for different uses.

Used to fuse data between bands. Used to produce the main band.

They are enumerated in RasterBand.hpp

Definition at line 508 of file GeoData.hpp.

Map the users' tags to their respective band number.

This map is very useful when retreiving information from bands using their names. Their names should be defined in a configuration file. The band number is used in GDAL in the function dataset->GetRasterBand(*num*)

See also:
loadConfigurationFile()

Definition at line 543 of file GeoData.hpp.

Virtual file detection flag.

This option is used to enable detection of virtual memory Dataset on which FlushCache is impossible.

0 - classical opening of a file on a hard memory device 1 - file created from a buffer with a file created on the virtual memory

Definition at line 241 of file GeoData.hpp.

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 524 of file GeoData.hpp.

Coefficient of affine Geo reference transformation array: [0] : X origin of left top corner of left top pixel [3] : Y origin of ...

[1] : Width in meters of this pixel [5] : Height in meters of this pixel [2] : Lines offset/shifts/drift [4] : Columns offset/shifts/drift

Definition at line 490 of file GeoData.hpp.

Limit used to evaluate intervisibility on real worlds since on simulated world everything is fully state-defined.

Terrain with a sum of P(all-traversable-classes) < simulationProbaVisionLimit are not transparent to vision.

Definition at line 532 of file GeoData.hpp.


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:39 for Jafar by doxygen 1.7.6.1
LAAS-CNRS