76 void initLayersPixelData();
77 void initLayersModelData(
const int& year_h=
DATA_NOW);
79 void applyForestReclassification();
81 void filterSubRegion(
string layerName_h);
83 void updateImage(
string layerName_h);
85 void addLayer(
string name_h,
string label_h,
bool isInteger_h,
bool dynamicContent_h,
string fullFileName_h =
"",
bool display_h=
true);
87 void resetLayer(
string layerName_h);
89 bool layerExist(
const string & layerName_h,
bool exactMatch =
true)
const;
91 Layers* getLayer(
const string& layerName_h);
103 void countItems(
const string& layerName_h,
const bool& debug=
false);
105 Pixel* getRandomPlotByValue(
string layer_h,
int layerValue__h);
107 vector <Pixel*> getAllPlotsByValue(
string layer_h,
int layerValue_h,
int outputLevel=
MSG_WARNING);
109 vector <Pixel*> getAllPlotsByValue(
string layer_h, vector<int> layerValues_h,
int outputLevel=
MSG_WARNING);
111 vector <Pixel*> getAllPlots(
bool masked=
true,
int outputLevel=
MSG_WARNING);
113 vector <Pixel*> getAllPlotsByRegion(
ModelRegion ®ion_h,
bool shuffle=
false);
114 vector <Pixel*> getAllPlotsByRegion(
int regId_h,
bool shuffle=
false);
116 vector <string> getLayerNames();
118 vector <Layers*> getLayerPointers();
120 void printLayers(
string layerName_h=
"");
122 void printBinMaps(
string layerName_h=
"");
126 void printDebugValues (
string layerName_h,
int min_h=0,
int max_h=0);
127 double getDistance(
const Pixel* px1,
const Pixel* px2);
132 double getHaByPixel()
const {
return ((xMetersByPixel*yMetersByPixel)/10000) ;};
147 int sub2realID(
int id_h);
148 string pack(
const string& parName,
const string& forName,
const string& dClass,
const int& year)
const {
return parName+
"#"+forName+
"#"+dClass+
"#"+i2s(year)+
"#";};
149 void unpack(
const string& key,
string& parName,
string& forName,
string& dClass,
int& year)
const;
151 void swap(
const int &swap_what);
154 void loadLayersDataFromFile();
155 void applySpatialStochasticValues();
156 void applyStochasticRiskAdversion();
int yNPixels
number of pixels along the Y dimension
double getYMetersByPixel() const
string pack(const string &parName, const string &forName, const string &dClass, const int &year) const
The required data is for the current year.
double getGeoLeftX() const
int subXR
sub region right X
double noValue
value internally use as novalue (individual layer maps can have other values)
double geoBottomY
geo-coordinates of the map bottom border
double geoTopY
geo-coordinates of the map upper border
vector< Pixel > pxVector
array of Pixel objects
double getGeoBottomY() const
double geoLeftX
geo-coordinates of the map left border
double getNoValue() const
double getXyNPixels() const
Return the number of pixels on Y.
Thread manager. Responsable to manage the main thread and "speak" with the GUI.
double geoRightX
geo-coordinates of the map right border
double getXMetersByPixel() const
double xMetersByPixel
pixel dimension (meters), X
int subXL
sub region left X
int getYNPixels() const
Return the number of pixels on X.
double getHaByPixel() const
Return the total number of pixels.
int subYT
sub region top Y
Define layer objects at the regional level.
vector< double > lUseTotals
totals, in ha, of area in the region for each type (cached values)
int xNPixels
number of pixels along the X dimension
Base class for the regmas application.
int subYB
sub region bottom Y
Class to manage the spatial dimension.
Pixel * getPixel(int x_h, int y_h)
double xyNPixels
total number of pixels
double getGeoTopY() const
Return a pixel pointer from its ID.
double getGeoRightX() const
This file is the header of BaseClass and it is included by ALL compiled code.
Pixel * getPixel(int ID_h)
Return a pixel pointer from its coordinates.
vector< Layers > layerVector
array of Layer objects
double yMetersByPixel
pixel dimension (meters), Y