Jafar
|
Class for GDAL data handling. More...
Class for GDAL data handling.
Definition at line 170 of file GeoData.hpp.
#include <GeoData.hpp>
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< BandDefinition > | geoBands |
Map the users' tags to their respective band number. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const GeoData &gd) |
Redefinition of operator <<. |
jafar::gramer::GeoData::GeoData | ( | const std::string & | _conffilename, |
FUSION_METHOD | _fmethod = FUSION_MEAN |
||
) |
Creates a GeoData object from a geodata configuration file.
_conffilename | File Path for a geodata configuration file. |
_fmethod | Fusion method enum value |
Constructor used to load a map from buffered data.
Destructor
bool jafar::gramer::GeoData::addBandToDataset | ( | BandDefinition & | inputinfo | ) |
Add a layer of information to the GDAL Dataset.
inputinfo | band information to load in memory |
void jafar::gramer::GeoData::addDataset | ( | GDALDataset * | _dataset | ) |
Add information to the GDAL Dataset.
_dataset | GDAL Dataset to fuse |
double jafar::gramer::GeoData::getProbabilityLag | ( | ) |
Get the probabilityLag.
double jafar::gramer::GeoData::getSigmaFactor | ( | ) |
Get the sigma factor used while the decomposition type is SIGMA.
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
conffile | Configuration file path |
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.
_dsfilename | File path of the file to open |
_useThisDataset | If not NULL Take precedence on _dsfilename |
bool jafar::gramer::GeoData::overlaps | ( | GeoData * | _toMerge | ) |
Verify if geodata is overlapping at least with 1 pixel with _toMerge geodata.
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)
_toMerge | GeoData to merge with the current data |
_aband | The band that is to be merged |
_geodata | GeoData to fuse with. |
_aband | Band number to fuse. |
innerRect | Zone in which data have to be fused |
fusingRect | Zone from which data will be fused Print useful information on the loaded geo data |
void jafar::gramer::GeoData::resetBands | ( | ) |
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)
void jafar::gramer::GeoData::setDecompositionLimit | ( | double | _dl | ) |
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.
at_i | i coordinate of the set pixel. |
at_j | j coordinate of the set pixel. |
inatt | Attributes, information input to set. |
internalTransfer | Default 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
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.
std::vector<BandDefinition> jafar::gramer::GeoData::geoBands [private] |
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*)
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.
double jafar::gramer::GeoData::probabilityLag [private] |
Admissible offset around a zone area to consider it nearly homogeneous.
Parameter used in the terraing segmentation during the quadtree decomposition
Definition at line 524 of file GeoData.hpp.
double jafar::gramer::GeoData::refGeoTransform[6] [private] |
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.
double jafar::gramer::GeoData::simulationProbaVisionLimit [private] |
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.
Generated on Wed Oct 15 2014 00:37:39 for Jafar by doxygen 1.7.6.1 |