Raster data (1D and 2D) I/O class Support I/O among ASCII file, TIFF, and MongoDB database. More...
#include <data_raster.hpp>
Public Member Functions | |
clsRasterData (bool is_2d=false) | |
Constructor an empty clsRasterData instance for 1D or 2D raster. | |
clsRasterData (T *data, int cols, int rows, T nodata, double dx, double xll, double yll, const STRING_MAP &opts=STRING_MAP()) | |
Constructor 1D raster from necessary data. | |
clsRasterData (T *data, int cols, int rows, T nodata, double dx, double xll, double yll, const string &srs) | |
Constructor 1D raster from necessary data. More... | |
clsRasterData (T **data2d, int cols, int rows, int nlayers, T nodata, double dx, double xll, double yll, const STRING_MAP &opts=STRING_MAP()) | |
Constructor 2D raster from necessary data. | |
clsRasterData (T **data2d, int cols, int rows, int nlayers, T nodata, double dx, double xll, double yll, const string &srs) | |
Constructor 2D raster from necessary data. More... | |
clsRasterData (const string &filename, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) | |
Constructor of clsRasterData instance from TIFF, ASCII, or other GDAL supported format, which has one data layer, referred to as Raster1D. More... | |
clsRasterData (vector< string > &filenames, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) | |
Constructor of clsRasterData instance from TIFF, ASCII, or other GDAL supported raster file, which may have one or more data layers, i.e., compatible with Raster1D and Rater2D. More... | |
clsRasterData (clsRasterData< MASK_T > *mask, T *values, int len, const STRING_MAP &opts=STRING_MAP()) | |
Construct an clsRasterData instance by 1D array data and mask. | |
clsRasterData (clsRasterData< MASK_T > *mask, T **values, int len, int lyrs, const STRING_MAP &opts=STRING_MAP()) | |
Construct an clsRasterData instance by 2D array data and mask. | |
clsRasterData (MongoGridFs *gfs, const char *remote_filename, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) | |
Constructor based on mongoDB. More... | |
clsRasterData (clsRasterData< T, MASK_T > *another) | |
Copy constructor. More... | |
~clsRasterData () | |
Destructor. | |
bool | ReadFromFile (const string &filename, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) |
Read raster data from file, mask data is optional. More... | |
bool | ReadFromFiles (vector< string > &filenames, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) |
Read raster data from two or more files, mask data is optional. More... | |
bool | ReadFromMongoDB (MongoGridFs *gfs, const string &filename, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) |
Read raster data from MongoDB. More... | |
bool | OutputToFile (const string &filename, bool out_origin=true) |
Write the whole raster to raster file, if 2D raster, output name will be corename_LyrNum. More... | |
bool | OutputSubsetToFile (bool out_origin=false, bool out_combined=true, const string &outname=string(), const map< vint, vector< double > > &recls=map< vint, vector< double > >(), double default_value=NODATA_VALUE) |
Write one or more raster's subset to files, default name format: corename_SubID_LyrNum. More... | |
bool | OutputAscFile (const string &filename) |
Write 1D or 2D raster data into ASC file(s) | |
bool | OutputFileByGdal (const string &filename) |
Write 1D or 2D raster data into TIFF file by GDAL. | |
bool | OutputToMongoDB (MongoGridFs *gfs, const string &filename=string(), const STRING_MAP &opts=STRING_MAP(), bool include_nodata=true, bool out_origin=true) |
Write the whole raster data to MongoDB, name format: corename__LyrNum. More... | |
bool | OutputSubsetToMongoDB (MongoGridFs *gfs, const string &filename=string(), const STRING_MAP &opts=STRING_MAP(), bool include_nodata=true, bool out_origin=false, bool out_combined=true, const map< vint, vector< double > > &recls=map< vint, vector< double > >(), double default_value=NODATA_VALUE) |
Write one or more raster's subset to MongoDB,. More... | |
void | SetHeader (const STRDBL_MAP &refers) |
void | SetCoreName (const string &name) |
Set new core file name. | |
void | SetValue (int row, int col, T value, int lyr=1) |
Set value to the given position and layer. | |
bool | SetCalcPositions () |
Set the flag of calc_pos_ to true and recalculate positions and stored raster data if necessary. | |
bool | SetPositions (int len, int **pdata) |
Set valid positions data, without mask raster layer. | |
bool | SetPositions (int len, int *pdata) |
bool | SetUseMaskExt () |
Set the flag of use_mask_ext_ to true and recalculate positions and stored raster data if necessary. | |
void | SetDataType (RasterDataType const type) |
Set raster data type. | |
void | SetDataType (const string &strtype) |
Set raster data type. | |
void | SetOutDataType (RasterDataType type) |
Set output raster data type. | |
void | SetOutDataType (const string &strtype) |
Set output raster data type. | |
void | SetDefaultValue (const double defaultv) |
Set default value. | |
bool | BuildSubSet (map< int, int > groups=map< int, int >()) |
Build subsets by given groups (cell value->group ID) or by discrete values (default) | |
bool | ReleaseSubset () |
Release subsets. | |
bool | RebuildSubSet (map< int, int > groups=map< int, int >()) |
Re-build subsets by given groups (cell value->group ID) or by discrete values. | |
void | CalculateStatistics () |
Calculate basic statistics values in one time Mean, Max, Min, STD, Range, etc. | |
void | UpdateStatistics () |
Force to update basic statistics values Mean, Max, Min, STD, Range, etc. | |
void | ReleaseStatsMap2D () |
Release statistics map of 2D raster data. | |
double | GetStatistics (string sindex, int lyr=1) |
Get basic statistics value Mean, Max, Min, STD, Range, etc. More... | |
void | GetStatistics (string sindex, int *lyrnum, double **values) |
Get basic statistics values for 2D raster data. More... | |
double | GetAverage (const int lyr=1) |
Get the average of raster data. More... | |
double | GetMaximum (const int lyr=1) |
Get the maximum of raster data. More... | |
double | GetMinimum (const int lyr=1) |
Get the minimum of raster data. More... | |
double | GetStd (const int lyr=1) |
Get the stand derivation of raster data. More... | |
double | GetRange (const int lyr=1) |
Get the range of raster data. More... | |
void | GetAverage (int *lyrnum, double **values) |
Get the average of 2D raster data. More... | |
void | GetMaximum (int *lyrnum, double **values) |
Get the maximum of 2D raster data. More... | |
void | GetMinimum (int *lyrnum, double **values) |
Get the minimum of 2D raster data. More... | |
void | GetStd (int *lyrnum, double **values) |
Get the standard derivation of 2D raster data. More... | |
void | GetRange (int *lyrnum, double **values) |
Get the range of 2D raster data. More... | |
void | GetValidNumber (int *lyrnum, double **values) |
Get the non-NoDATA number of 2D raster data. More... | |
int | GetValidNumber (const int lyr=1) |
Get the non-NoDATA cells number of the given raster layer data. More... | |
int | GetCellNumber () const |
int | GetDataLength () const |
Get the first dimension size. More... | |
int | GetCols () const |
int | GetRows () const |
Get column number. | |
double | GetCellWidth () const |
Get row number. | |
double | GetXllCenter () const |
Get cell size. More... | |
double | GetYllCenter () const |
Get Y coordinate of left lower center of raster data. | |
int | GetLayers () const |
RasterDataType | GetDataType () const |
Get layer number. | |
RasterDataType | GetOutDataType () const |
Get data type of source. | |
T | GetNoDataValue () const |
Get data type of output. | |
double | GetDefaultValue () const |
Get NoDATA value. | |
int | GetPosition (int row, int col) |
Get default value. More... | |
int | GetPosition (float x, float y) |
Get position index in 1D raster data for given coordinate (x,y) | |
int | GetPosition (double x, double y) |
Get position index in 1D raster data for given coordinate (x,y) | |
map< int, SubsetPositions * > & | GetSubset () |
Get subset. | |
bool | GetRasterData (int *n_cells, T **data) |
Get raster data, include valid cell number and data. More... | |
bool | Get2DRasterData (int *n_cells, int *n_lyrs, T ***data) |
Get 2D raster data, include valid cell number of each layer, layer number, and data. More... | |
const STRDBL_MAP & | GetRasterHeader () const |
Get raster header information. | |
const STRDBL_MAP & | GetStatistics () const |
Get raster statistics information. | |
const map< string, double * > & | GetStatistics2D () const |
Get raster statistics information of 2D raster. | |
string | GetFilePath () const |
Get full path name. | |
string | GetCoreName () const |
Get core name. | |
void | GetRasterPositionData (int *datalength, int ***positiondata) |
Get position index data and the data length. More... | |
void | GetRasterPositionData (int *datalength, int **positiondata) |
T * | GetRasterDataPointer () const |
int ** | GetRasterPositionDataPointer () const |
Get pointer of raster 1D data. | |
int * | GetRasterPositionIndexPointer () const |
Get pointer of position data. | |
T ** | Get2DRasterDataPointer () const |
Get pointer of position data. | |
const char * | GetSrs () |
Get pointer of raster 2D data. | |
string | GetSrsString () |
Get the spatial reference (char*) | |
string | GetOption (const char *key) |
Get the spatial reference (string) | |
const STRING_MAP & | GetOptions () const |
Get option by key, including the spatial reference by "SRS". | |
T | GetValueByIndex (int cell_index, int lyr=1) |
Get options. More... | |
void | GetValueByIndex (int cell_index, T *&values) |
Get raster data at the valid cell index (both for 1D and 2D raster) More... | |
T | GetValue (int row, int col, int lyr=1) |
Get raster data via row and col The default lyr is 1, which means the 1D raster data, or the first layer of 2D data. | |
void | GetValue (int row, int col, T *&values) |
Get raster data (both for 1D and 2D raster) at the (row, col) More... | |
bool | IsNoData (const int row, const int col, const int lyr=1) |
Check if the raster data is NoData via row and col The default lyr is 1, which means the 1D raster data, or the first layer of 2D data. | |
bool | Is2DRaster () const |
bool | PositionsCalculated () const |
Is 2D raster data? | |
bool | PositionsAllocated () const |
Calculate positions or not. | |
bool | MaskExtented () const |
position data is allocated or a pointer | |
bool | StatisticsCalculated () const |
Use mask extent or not. | |
bool | Initialized () const |
Basic statistics calculated? | |
bool | ValidateRasterData () |
Instance of clsRasterData initialized? More... | |
bool | ValidateRowCol (const int row, const int col) |
Validate the input row and col. | |
bool | ValidateLayer (const int lyr) |
Validate the input layer number. | |
bool | ValidateIndex (const int idx) |
Validate the input index. | |
string | GetFullFileName () const |
Get full filename. | |
clsRasterData< MASK_T > * | GetMask () const |
Get mask data pointer. | |
void | Copy (clsRasterData< T, MASK_T > *orgraster) |
Copy clsRasterData object. | |
void | ReplaceNoData (T replacedv) |
Replace NoData value by the given value. | |
void | Reclassify (map< int, T > reclass_map) |
classify raster | |
XY_COOR | GetCoordinateByRowCol (int row, int col) |
Calculate XY coordinates by given row and col number. More... | |
ROW_COL | GetPositionByCoordinate (double x, double y, STRDBL_MAP *header=nullptr) |
Calculate position by given coordinate. More... | |
Static Public Member Functions | |
static clsRasterData< T, MASK_T > * | Init (const string &filename, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) |
Validation check before the construction of clsRasterData, i.e., the raster file is existed and the data format supported. More... | |
static clsRasterData< T, MASK_T > * | Init (vector< string > &filenames, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) |
Validation check before the constructor of clsRasterData, i.e., the raster files are all existed and the data format supported. More... | |
static clsRasterData< T, MASK_T > * | Init (MongoGridFs *gfs, const char *remote_filename, bool calc_pos=false, clsRasterData< MASK_T > *mask=nullptr, bool use_mask_ext=true, double default_value=NODATA_VALUE, const STRING_MAP &opts=STRING_MAP()) |
Validation check before the constructor of clsRasterData. | |
Raster data (1D and 2D) I/O class Support I/O among ASCII file, TIFF, and MongoDB database.
ccgl::data_raster::clsRasterData< T, MASK_T >::clsRasterData | ( | T * | data, |
int | cols, | ||
int | rows, | ||
T | nodata, | ||
double | dx, | ||
double | xll, | ||
double | yll, | ||
const string & | srs | ||
) |
Constructor 1D raster from necessary data.
srs
is highly recommended replaced by map<string, string>
. ccgl::data_raster::clsRasterData< T, MASK_T >::clsRasterData | ( | T ** | data2d, |
int | cols, | ||
int | rows, | ||
int | nlayers, | ||
T | nodata, | ||
double | dx, | ||
double | xll, | ||
double | yll, | ||
const string & | srs | ||
) |
Constructor 2D raster from necessary data.
srs
is highly recommended replaced by map<string, string>
.
|
explicit |
Constructor of clsRasterData instance from TIFF, ASCII, or other GDAL supported format, which has one data layer, referred to as Raster1D.
[in] | filename | Full path of the raster file |
[in] | calc_pos | Calculate positions of valid cells excluding NODATA. The default is false. |
[in] | mask | clsRasterData<MASK_T> Mask layer |
[in] | use_mask_ext | Use mask layer extent, even NoDATA exists. |
[in] | default_value | Default value when mask data exceeds the raster extend. |
[in] | opts | (Optional) Additional options of the raster data with the format of key-value |
|
explicit |
Constructor of clsRasterData instance from TIFF, ASCII, or other GDAL supported raster file, which may have one or more data layers, i.e., compatible with Raster1D and Rater2D.
[in] | filenames | Full paths vector of the 2D raster data |
[in] | calc_pos | Calculate positions of valid cells excluding NODATA. The default is false. |
[in] | mask | clsRasterData<MASK_T> Mask layer |
[in] | use_mask_ext | Use mask layer extent, even NoDATA exists. |
[in] | default_value | Default value when mask data exceeds the raster extend. |
[in] | opts | (Optional) Additional options of the raster data with the format of key-value |
ccgl::data_raster::clsRasterData< T, MASK_T >::clsRasterData | ( | MongoGridFs * | gfs, |
const char * | remote_filename, | ||
bool | calc_pos = false , |
||
clsRasterData< MASK_T > * | mask = nullptr , |
||
bool | use_mask_ext = true , |
||
double | default_value = NODATA_VALUE , |
||
const STRING_MAP & | opts = STRING_MAP() |
||
) |
Constructor based on mongoDB.
[in] | gfs | mongoc_gridfs_t |
[in] | remote_filename | char* |
[in] | calc_pos | Calculate positions of valid cells excluding NODATA. The default is false. |
[in] | mask | clsRasterData<MASK_T> Mask layer |
[in] | use_mask_ext | Use mask layer extent, even NoDATA exists. |
[in] | default_value | Default value when mask data exceeds the raster extend. |
[in] | opts | Optional key-value stored in metadata |
|
explicit |
Copy constructor.
bool ccgl::data_raster::clsRasterData< T, MASK_T >::Get2DRasterData | ( | int * | n_cells, |
int * | n_lyrs, | ||
T *** | data | ||
) |
Get 2D raster data, include valid cell number of each layer, layer number, and data.
|
inline |
Get the average of raster data.
[in] | lyr | optional for 1D and the first layer of 2D raster data. |
|
inline |
Get the average of 2D raster data.
[out] | lyrnum | int layer number |
[out] | values | double* Statistics array |
XY_COOR ccgl::data_raster::clsRasterData< T, MASK_T >::GetCoordinateByRowCol | ( | int | row, |
int | col | ||
) |
Calculate XY coordinates by given row and col number.
[in] | row | Row number |
[in] | col | Col number |
|
inline |
Get the first dimension size.
Get the actual stored length of raster data
|
inline |
Get the maximum of raster data.
|
inline |
Get the maximum of 2D raster data.
|
inline |
Get the minimum of raster data.
|
inline |
Get the minimum of 2D raster data.
int ccgl::data_raster::clsRasterData< T, MASK_T >::GetPosition | ( | int | row, |
int | col | ||
) |
Get default value.
Get position index in 1D raster data for specific row and column
ROW_COL ccgl::data_raster::clsRasterData< T, MASK_T >::GetPositionByCoordinate | ( | double | x, |
double | y, | ||
STRDBL_MAP * | header = nullptr |
||
) |
Calculate position by given coordinate.
[in] | x | X coordinate |
[in] | y | Y coordinate |
[in] | header | Optional, header map of raster layer data, the default is m_header |
|
inline |
Get the range of raster data.
|
inline |
Get the range of 2D raster data.
bool ccgl::data_raster::clsRasterData< T, MASK_T >::GetRasterData | ( | int * | n_cells, |
T ** | data | ||
) |
Get raster data, include valid cell number and data.
void ccgl::data_raster::clsRasterData< T, MASK_T >::GetRasterPositionData | ( | int * | datalength, |
int *** | positiondata | ||
) |
Get position index data and the data length.
[out] | datalength | Data length |
[out] | positiondata | The pointer of 2D array (pointer) |
void ccgl::data_raster::clsRasterData< T, MASK_T >::GetStatistics | ( | string | sindex, |
int * | lyrnum, | ||
double ** | values | ||
) |
Get basic statistics values for 2D raster data.
Mean, Max, Min, STD, Range, etc.
[in] | sindex | string case insensitive |
[out] | lyrnum | int layer number |
[out] | values | double* Statistics array or nullptr |
double ccgl::data_raster::clsRasterData< T, MASK_T >::GetStatistics | ( | string | sindex, |
int | lyr = 1 |
||
) |
Get basic statistics value Mean, Max, Min, STD, Range, etc.
[in] | sindex | string case insensitive |
[in] | lyr | optional for 1D and the first layer of 2D raster data. |
|
inline |
Get the stand derivation of raster data.
|
inline |
Get the standard derivation of 2D raster data.
|
inline |
Get the non-NoDATA cells number of the given raster layer data.
|
inline |
Get the non-NoDATA number of 2D raster data.
void ccgl::data_raster::clsRasterData< T, MASK_T >::GetValue | ( | int | row, |
int | col, | ||
T *& | values | ||
) |
Get raster data (both for 1D and 2D raster) at the (row, col)
[in] | row | Row index |
[in] | col | Col index |
[out] | values | A float array with the length of n_lyrs_ |
T ccgl::data_raster::clsRasterData< T, MASK_T >::GetValueByIndex | ( | int | cell_index, |
int | lyr = 1 |
||
) |
Get options.
Get raster data at the valid cell index The default lyr is 1, which means the 1D raster data, or the first layer of 2D data.
void ccgl::data_raster::clsRasterData< T, MASK_T >::GetValueByIndex | ( | int | cell_index, |
T *& | values | ||
) |
Get raster data at the valid cell index (both for 1D and 2D raster)
[in] | cell_index | Cell's index in the first dimension |
[out] | values | A float array with length as n_lyrs_ which should be release in the invoke code |
|
inline |
Get cell size.
Get X coordinate of left lower center of raster data
|
static |
Validation check before the construction of clsRasterData, i.e., the raster file is existed and the data format supported.
This is the recommended way to construct an instance of clsRasterData.
|
static |
Validation check before the constructor of clsRasterData, i.e., the raster files are all existed and the data format supported.
This is the recommended way to construct an instance of clsRasterData, compatible with Raster1D and Rater2D.
bool ccgl::data_raster::clsRasterData< T, MASK_T >::OutputSubsetToFile | ( | bool | out_origin = false , |
bool | out_combined = true , |
||
const string & | outname = string() , |
||
const map< vint, vector< double > > & | recls = map<vint, vector<double> >() , |
||
double | default_value = NODATA_VALUE |
||
) |
Write one or more raster's subset to files, default name format: corename_SubID_LyrNum.
out_origin | (Optional) Output original raster data or data_ assigned for subset |
out_combined | (Optional) Output combined data of subset |
outname | (Optional) Output filename, if not specified, use origin directory and default name |
recls | (Optional) Reclassification map, no need to SetData before output subset |
default_value | (Optional) Default value for missed type of reclassification map |
bool ccgl::data_raster::clsRasterData< T, MASK_T >::OutputSubsetToMongoDB | ( | MongoGridFs * | gfs, |
const string & | filename = string() , |
||
const STRING_MAP & | opts = STRING_MAP() , |
||
bool | include_nodata = true , |
||
bool | out_origin = false , |
||
bool | out_combined = true , |
||
const map< vint, vector< double > > & | recls = map<vint, vector<double> >() , |
||
double | default_value = NODATA_VALUE |
||
) |
Write one or more raster's subset to MongoDB,.
File name format in GridFS: corename_SubID_LyrNum, if SubID < 0, use 'n' as the prefix. e.g., corename_n1_1, corename_2_1, corename_3_1
gfs | mongoc_gridfs_t |
filename | (Optional) Core file name |
opts | (Optional) Key-value map for additional user-specific metadata |
include_nodata | (Optional) Include nodata or not |
out_origin | (Optional) Output original raster data or data_ assigned for subset |
out_combined | (Optional) Output combined data of subset |
recls | (Optional) Reclassification map, no need to SetData before output subset |
default_value | (Optional) Default value for missed type of reclassification map |
bool ccgl::data_raster::clsRasterData< T, MASK_T >::OutputToFile | ( | const string & | filename, |
bool | out_origin = true |
||
) |
Write the whole raster to raster file, if 2D raster, output name will be corename_LyrNum.
filename | filename with prefix, e.g. ".asc" and ".tif" |
out_origin | (Optional) Write combination of original data or subset's data |
bool ccgl::data_raster::clsRasterData< T, MASK_T >::OutputToMongoDB | ( | MongoGridFs * | gfs, |
const string & | filename = string() , |
||
const STRING_MAP & | opts = STRING_MAP() , |
||
bool | include_nodata = true , |
||
bool | out_origin = true |
||
) |
Write the whole raster data to MongoDB, name format: corename__LyrNum.
gfs | mongoc_gridfs_t |
filename | (Optional) File name, default is the core file name of input |
opts | (Optional) Key-value map for user-specific metadata |
include_nodata | (Optional) Include nodata or not |
out_origin | (Optional) Output original raster data or subset's data |
bool ccgl::data_raster::clsRasterData< T, MASK_T >::ReadFromFile | ( | const string & | filename, |
bool | calc_pos = false , |
||
clsRasterData< MASK_T > * | mask = nullptr , |
||
bool | use_mask_ext = true , |
||
double | default_value = NODATA_VALUE , |
||
const STRING_MAP & | opts = STRING_MAP() |
||
) |
Read raster data from file, mask data is optional.
[in] | filename | string |
[in] | calc_pos | Calculate positions of valid cells excluding NODATA. The default is false. |
[in] | mask | clsRasterData<MASK_T> |
[in] | use_mask_ext | Use mask layer extent, even NoDATA exists. |
[in] | default_value | Default value when mask data exceeds the raster extend. |
[in] | opts | Optional key-value stored in metadata |
bool ccgl::data_raster::clsRasterData< T, MASK_T >::ReadFromFiles | ( | vector< string > & | filenames, |
bool | calc_pos = false , |
||
clsRasterData< MASK_T > * | mask = nullptr , |
||
bool | use_mask_ext = true , |
||
double | default_value = NODATA_VALUE , |
||
const STRING_MAP & | opts = STRING_MAP() |
||
) |
Read raster data from two or more files, mask data is optional.
bool ccgl::data_raster::clsRasterData< T, MASK_T >::ReadFromMongoDB | ( | MongoGridFs * | gfs, |
const string & | filename, | ||
bool | calc_pos = false , |
||
clsRasterData< MASK_T > * | mask = nullptr , |
||
bool | use_mask_ext = true , |
||
double | default_value = NODATA_VALUE , |
||
const STRING_MAP & | opts = STRING_MAP() |
||
) |
Read raster data from MongoDB.
[in] | gfs | mongoc_gridfs_t |
[in] | filename | char*, raster file name |
[in] | calc_pos | Calculate positions of valid cells excluding NODATA. The default is false. |
[in] | mask | clsRasterData<MASK_T> |
[in] | use_mask_ext | Use mask layer extent, even NoDATA exists. |
[in] | default_value | Default value when mask data exceeds the raster extend. |
[in] | opts | Optional key-value stored in metadata, used to filter GridFs file |
|
inline |
Instance of clsRasterData initialized?
Validate the available of raster data, both 1D and 2D data