#include <merisfiledata.h>
Public Member Functions | |
MerisFileData (const string &name=string(""), const string &mode=string("r")) | |
virtual void * | read_data (void *data, const char *sds_name, int *start=NULL, int *stride=NULL, int *edges=NULL, int rank=-1) |
Read the selected data in the file. | |
vector< int > | get_dataset_dimension (const string &sds_name) |
return the given dataset size along each axis | |
void | get_dataset_fill_value (const string &sds_name, void *fill_value) |
read the given dataset's fill value TODO Same method with many names of this method transfered from filedatareader. Need to be reformatted after functionnal tests with Data2Grid/MapsOperator | |
int | get_n_dataset () |
string | get_dataset_name (int i) |
int | get_dataset_data_type (string sds_name) |
string | get_values_attr_dataset (string sds_name, string attr_name) |
bool | has_attr_dataset (string sds_name, string attr_name) |
string | get_values_attr (string attr_name) |
bool | has_attr (string attr_name) |
string | get_filename () |
alias to get_name method, dfor data2grid/mapsoperator compatibility | |
string | get_product () |
void | close_data_file () |
closes the file | |
void | open_data_file () |
open the file | |
void | get_fillValue (const string &sds_name, void *fillValue) |
void | get_scaling_type_of_raw (const string &sds_name, float64 &scale, float64 &offset, int &type) |
Protected Member Functions | |
string | getMonth (const string &month) |
void | getFillValues (char8 &fillvalue) |
void | getFillValues (uchar8 &fillvalue) |
void | getFillValues (int16 &fillvalue) |
void | getFillValues (uint16 &fillvalue) |
void | getFillValues (int32 &fillvalue) |
void | getFillValues (uint32 &fillvalue) |
void | getFillValues (float32 &fillvalue) |
void | getFillValues (float64 &fillvalue) |
string | epr_get_field_elem_as_str (const EPR_SField *field) |
void | get_scaling (const string &sds_name, float64 &scale, float64 &offset) |
Protected Attributes | |
EPR_SProductId * | product_id |
string | filename |
int | width |
int | height |
string MerisFileData::epr_get_field_elem_as_str | ( | const EPR_SField * | field | ) | [protected] |
Interprates a memory data as a string.
field | the pointer at the array to convert |
char
typed element or NULL
if an error occured. References EPR_FieldInfo::data_type_id, EPR_Field::elems, EPR_Field::info, and EPR_FieldInfo::num_elems.
vector< int > MerisFileData::get_dataset_dimension | ( | const string & | sds_name | ) | [virtual] |
return the given dataset size along each axis
ds_name | [IN] dataset name |
Reimplemented from FileData.
void MerisFileData::get_dataset_fill_value | ( | const string & | ds_name, | |
void * | fillvalue | |||
) | [virtual] |
read the given dataset's fill value TODO Same method with many names of this method transfered from filedatareader. Need to be reformatted after functionnal tests with Data2Grid/MapsOperator
ds_name | [IN] dataset name | |
fillvalue | [OUT] fill value. |
Reimplemented from FileData.
string MerisFileData::get_filename | ( | ) | [inline, virtual] |
alias to get_name method, dfor data2grid/mapsoperator compatibility
Reimplemented from FileData.
void * MerisFileData::read_data | ( | void * | data, | |
const char * | sds_name, | |||
int * | start = NULL , |
|||
int * | stride = NULL , |
|||
int * | edges = NULL , |
|||
int | rank = -1 | |||
) | [virtual] |
Read the selected data in the file.
data | the buffer to fill with the read values. Can be NULL. In this case, the allocation is done by the method | |
sds_name | the name of the sds (Scientific Data Set) we want to access. | |
start | begining of the selection. If NULL, start at (0,0) if rank is 2 ; (0,0,0) if rank is 3... | |
stride | step between 2 interesting values. If NULL, this step is set to 1 in each dimension (ie all values will be read) | |
edges | number of values to be read in each dimension. if NULL, it will be all data along each dimension. | |
rank | the dimension of start, stride and edges |
Implements FileData.
References EPR_Raster::buffer, EPR_Raster::data_type, EPR_BandId::data_type, EPR_FieldInfo::data_type_id, EPR_BandId::dataset_ref, EPR_RecordInfo::field_infos, EPR_Record::info, EPR_Raster::raster_height, EPR_Raster::raster_width, and EPR_BandId::sample_model.