8#ifndef FMTareaparser_H_INCLUDED
9#define FMTareaparser_H_INCLUDED
17#include <boost/regex.hpp>
27 class FMTactualdevelopment;
28 class FMTGCBMtransition;
74 const std::string& age,
double agefactor = 1.0,
double areafactor = 0.0001, std::string lock =
"")
const;
96 const std::vector<Core::FMTtheme>& themes,
97 const std::vector<std::string>& data_rasters,
98 const std::string& age,
99 const std::string& lock,
100 std::vector<std::map<std::string, std::string>> mapping = std::vector<std::map<std::string, std::string>>())
const;
108 const std::string& location,
109 const std::map<std::string, std::string>& mapping,
110 std::string format =
"GTiff")
const;
120 const std::vector<Core::FMTaction>& actions,
121 const std::vector<Core::FMTtheme>& themes,
122 const int& period)
const;
130 std::vector<std::vector<Graph::FMTpredictor>>
writepredictors(
const std::string& location,
132 const std::vector<std::string>& yieldnames,
135 bool periodonevalues =
false,
136 bool withGCBMid =
true)
const;
156 std::vector<Heuristics::FMToperatingareascheme>
getschemeneighbors(std::vector<Heuristics::FMToperatingareascheme> operatingareaparameters,
157 const std::vector<Core::FMTtheme>& themes,
const std::string& data_vectors,
158 const std::string& agefield,
const std::string& areafield,
double agefactor = 1.0,
159 double areafactor = 1, std::string lockfield =
"",
160 double minimal_area = 0.0,
double buffersize = 100)
const;
168 std::vector<Heuristics::FMToperatingareacluster>
getclusters(
const std::vector<Heuristics::FMToperatingarea>& operatingareas,
169 const std::vector<Core::FMTtheme>& themes,
const std::string& data_vectors,
170 const std::string& agefield,
const std::string& areafield,
const double& maximaldistance,
171 double agefactor = 1.0,
double areafactor = 1, std::string lockfield =
"",
172 double minimal_area = 0.0,
double buffersize = 100)
const;
173 std::vector<Heuristics::FMToperatingareascheme>
getOperatingArea(
const std::string& fichierShp,
const std::vector<Core::FMTtheme>& themes,
const int& numeroTheme,
const int& startingperiod,
const std::string& nomChampAge,
const std::string& nomChampSuperficie,
const std::string& nomChampStanlock,
const std::string& fichierParam)
const;
180 std::vector<Heuristics::FMToperatingareascheme>
readOAschedulerparameters(
const std::string& location,
const std::vector<Core::FMTtheme>& modelthemes,
const int& themetarget,
const int& startingperiod)
const;
187 std::vector<std::string> creationoptions = std::vector<std::string>())
const;
195 std::vector<Core::FMTactualdevelopment>
readvectors(
const std::vector<Core::FMTtheme>& themes,
const std::string& data_vectors,
196 const std::string& agefield,
const std::string& areafield,
double agefactor = 1.0,
197 double areafactor = 1, std::string lockfield =
"",
198 double minimalarea = 0.0)
const;
204 const int& resolution,
const std::vector<Core::FMTtheme>& themes,
205 const std::string& agefield,
const std::string& areafield,
double agefactor = 1.0,
206 double areafactor = 1, std::string lockfield =
"",
207 double minimalarea = 0.0,
const std::string& writeforestfolder =
"",
208 const bool& fittoforel =
true)
const;
214 const std::string& tifpathandname,
215 const int& resolution,
216 const std::string& field,
217 bool fittoforel =
true)
const;
226 GDALDataset*
OGRlayertoRaster(OGRLayer* layer,
const std::string& fieldname,
const std::string& outfilename,
const int& resolution,
const bool& fittoforel)
const;
253 std::vector<Core::FMTactualdevelopment>
read(
const std::vector<Core::FMTtheme>& themes,
const Core::FMTconstants& constants,
const std::string& location);
259 void write(
const std::vector<Core::FMTactualdevelopment>& areas,
const std::string& location)
const;
263 const static boost::regex rxcleanarea;
269 std::string getperiodpathname(
const std::string& location,
const int& period,
const std::string& name)
const;
279 const std::vector<Core::FMTtheme>& themes)
const;
285 template<
typename T,
typename outT>
286 void writeband(
const Spatial::FMTlayer<T>& layer, GDALRasterBand* wband,
const std::map<T, std::string>& mapping)
const;
292 std::vector<OGRPolygon*> getunion(
const std::vector<OGRMultiPolygon>& multipartpolygons)
const;
297 void destroypolygons(std::vector<OGRPolygon*>& polygonstodestroy)
const;
306 const std::vector<Core::FMTtheme>& themes,
307 const std::map<int, int>& themes_fields,
308 const int& age_field,
309 const int& lock_field,
310 const int& area_field,
311 const double& agefactor,
312 const double& areafactor,
313 const double& minimalarea)
const;
320 void validate_raster(
const std::vector<std::string>&data_rasters)
const;
327 GDALDataset* openvectorfile(std::map<int, int>&themes_fields,
int& age_field,
int& lock_field,
int& area_field,
328 const std::string& data_vectors,
const std::string& agefield,
const std::string& areafield,
const std::string& lockfield,
329 const std::vector<Core::FMTtheme>& themes)
const;
337 std::vector<OGRMultiPolygon>getmultipolygons(
const std::vector<Heuristics::FMToperatingarea>& operatingareas,
338 const std::vector<Core::FMTtheme>& themes,
const std::string& data_vectors,
339 const std::string& agefield,
const std::string& areafield,
double agefactor = 1.0,
340 double areafactor = 1, std::string lockfield =
"",
341 double minimal_area = 0.0)
const;
349 std::vector<Heuristics::FMToperatingarea> getneighborsfrompolygons(
const std::vector<OGRPolygon*>&polygons,
350 std::vector<Heuristics::FMToperatingarea> operatingareas,
351 const double& buffersize)
const;
358 std::vector<Heuristics::FMToperatingareacluster> getclustersfrompolygons(
const std::vector<OGRPolygon*>&polygons,
359 const std::vector<Heuristics::FMToperatingarea>& operatingareas,
360 const double& maximaldistance)
const;
369 Spatial::FMTforest getFMTforestfromlayer(OGRLayer* layer,
const std::vector<Core::FMTactualdevelopment>& actualdevs,
const std::string& devidfield,
const int& resolution,
const double& areafactor,
const bool& fittoforel)
const;
376 OGRLayer* subsetlayer(OGRLayer*layer,
const std::vector<Core::FMTtheme>& themes,
377 const std::string& agefield,
const std::string& areafield)
const;
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTactualdevelopment.hpp:25
Definition: FMTconstants.hpp:29
Definition: FMTtheme.hpp:47
Definition: FMTpredictor.hpp:29
Definition: FMToperatingarea.hpp:29
Definition: FMToperatingareacluster.hpp:28
Definition: FMToperatingareascheme.hpp:44
Definition: FMTmodel.hpp:60
Definition: FMTareaparser.hpp:64
std::vector< Heuristics::FMToperatingareascheme > getschemeneighbors(std::vector< Heuristics::FMToperatingareascheme > operatingareaparameters, const std::vector< Core::FMTtheme > &themes, const std::string &data_vectors, const std::string &agefield, const std::string &areafield, double agefactor=1.0, double areafactor=1, std::string lockfield="", double minimal_area=0.0, double buffersize=100) const
Spatial::FMTforest readrasters(const std::vector< Core::FMTtheme > &themes, const std::vector< std::string > &data_rasters, const std::string &age, double agefactor=1.0, double areafactor=0.0001, std::string lock="") const
std::vector< Heuristics::FMToperatingareascheme > getOperatingArea(const std::string &fichierShp, const std::vector< Core::FMTtheme > &themes, const int &numeroTheme, const int &startingperiod, const std::string &nomChampAge, const std::string &nomChampSuperficie, const std::string &nomChampStanlock, const std::string &fichierParam) const
Spatial::FMTforest vectormaptoFMTforest(const std::string &data_vectors, const int &resolution, const std::vector< Core::FMTtheme > &themes, const std::string &agefield, const std::string &areafield, double agefactor=1.0, double areafactor=1, std::string lockfield="", double minimalarea=0.0, const std::string &writeforestfolder="", const bool &fittoforel=true) const
bool writeforest(const Spatial::FMTforest &for_layer, const std::vector< Core::FMTtheme > &themes, const std::vector< std::string > &data_rasters, const std::string &age, const std::string &lock, std::vector< std::map< std::string, std::string > > mapping=std::vector< std::map< std::string, std::string > >()) const
std::vector< Heuristics::FMToperatingareacluster > getclusters(const std::vector< Heuristics::FMToperatingarea > &operatingareas, const std::vector< Core::FMTtheme > &themes, const std::string &data_vectors, const std::string &agefield, const std::string &areafield, const double &maximaldistance, double agefactor=1.0, double areafactor=1, std::string lockfield="", double minimal_area=0.0, double buffersize=100) const
void writeOAschedulerparameters(const std::string &location, const std::vector< Heuristics::FMToperatingareascheme > &OAschemes, std::vector< std::string > creationoptions=std::vector< std::string >()) const
std::vector< Core::FMTactualdevelopment > read(const std::vector< Core::FMTtheme > &themes, const Core::FMTconstants &constants, const std::string &location)
bool writelayer(const Spatial::FMTlayer< double > &layer, std::string location, std::string format="GTiff") const
void write(const std::vector< Core::FMTactualdevelopment > &areas, const std::string &location) const
FMTareaparser(const FMTareaparser &rhs)=default
void vectorfieldtoraster(const std::string &data_vectors, const std::string &tifpathandname, const int &resolution, const std::string &field, bool fittoforel=true) const
std::vector< std::vector< Graph::FMTpredictor > > writepredictors(const std::string &location, const Spatial::FMTspatialschedule &spatialsolution, const std::vector< std::string > &yieldnames, const Models::FMTmodel &model, const int &period, bool periodonevalues=false, bool withGCBMid=true) const
bool writelayer(const Spatial::FMTlayer< T > &layer, std::string location, const std::map< T, std::string > &mapping, std::string format="GTiff") const
bool writeforesttheme(const Spatial::FMTforest &for_layer, const Core::FMTtheme &theme, const std::string &location, const std::map< std::string, std::string > &mapping, std::string format="GTiff") const
GDALDataset * OGRlayertoRaster(OGRLayer *layer, const std::string &fieldname, const std::string &outfilename, const int &resolution, const bool &fittoforel) const
std::vector< Core::FMTactualdevelopment > readvectors(const std::vector< Core::FMTtheme > &themes, const std::string &data_vectors, const std::string &agefield, const std::string &areafield, double agefactor=1.0, double areafactor=1, std::string lockfield="", double minimalarea=0.0) const
std::vector< Heuristics::FMToperatingareascheme > readOAschedulerparameters(const std::string &location, const std::vector< Core::FMTtheme > &modelthemes, const int &themetarget, const int &startingperiod) const
std::vector< Core::FMTGCBMtransition > writedisturbances(const std::string &location, const Spatial::FMTspatialschedule &disturbances, const std::vector< Core::FMTaction > &actions, const std::vector< Core::FMTtheme > &themes, const int &period) const
Definition: FMTparser.hpp:66
Definition: FMTforest.hpp:27
Definition: FMTlayer.hpp:29
Definition: FMTspatialschedule.hpp:44
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTaction.hpp:31
Namespace for using/building unidirectional graphs in FMT.
Definition: FMTareaparser.hpp:31
Namespace regrouping all tools for solving LP/MIP problems using an heuristic.
Definition: FMTareaparser.hpp:43
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50
Namespace handling all FMT's parsers. Everything related to I/O should be located in this namespace.
Definition: FMTactionparser.hpp:26
The spatial namespace provides classes for spatialy explicit simulation/optimization based on raster ...
Definition: FMTareaparser.hpp:36