FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
RexportParser.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef REXPORTParser_H_INCLUDED
9#define REXPORTParser_H_INCLUDED
10
11#include "FMTobject.hpp"
12#include "FMTparser.hpp"
14#include "FMTconstantparser.hpp"
15#include "FMTlifespanparser.hpp"
16#include "FMTyieldparser.hpp"
17#include "FMTareaparser.hpp"
18#include "FMTactionparser.hpp"
20#include "FMToutputparser.hpp"
21#include "FMTscheduleparser.hpp"
23#include "FMTmodelparser.hpp"
24#include <Rcpp.h>
25#include <string>
26#include "Rdefinitions.hpp"
27
32//RCPP_DEFINEMAP(std::string, std::string); //map of string definition
53
54
55
56namespace R
57{
59 {
60 Rcpp::class_<Parser::FMTparser>("FMTparser", "@DocString(FMTparser)")
61 .derives<Core::FMTobject>("FMTobject")
62 .constructor("@DocString(FMTparser())");
63 Rcpp::class_<Parser::FMTareaparser>("FMTareaparser", "@DocString(FMTareaparser)")
64 .derives<Parser::FMTparser>("FMTparser")
65 .constructor("@DocString(FMTareaparser())")
66 .method("read", &Parser::FMTareaparser::read,
67 "@DocString(FMTareaparser::read)")
68 #ifdef FMTWITHGDAL
69 .method("readvectors", &Parser::FMTareaparser::readvectors,
70 "@DocString(FMTareaparser::readvectors)")
71 .method("readrasters", &Parser::FMTareaparser::readrasters,
72 "@DocString(FMTareaparser::readrasters)")
73 .method("vectormaptoFMTforest", &Parser::FMTareaparser::vectormaptoFMTforest,
74 "@DocString(FMTareaparser::vectormaptoFMTforest)")
75 .method("vectorfieldtoraster", &Parser::FMTareaparser::vectorfieldtoraster,
76 "@DocString(FMTareaparser::vectorfieldtoraster)")
77 .method("writeforest",&Parser::FMTareaparser::writeforest,
78 "@DocString(FMTareaparser::writeforest)")
79 .method("writedisturbances",&Parser::FMTareaparser::writedisturbances,
80 "@DocString(FMTareaparser::writedisturbances)")
81 #ifdef FMTWITHOSI
82 .method("getschemeneighbors",&Parser::FMTareaparser::getschemeneighbors,
83 "@DocString(FMTareaparser::getschemeneighbors)")
84 .method("getclusters",&Parser::FMTareaparser::getclusters,
85 "@DocString(FMTareaparser::getclusters)")
86 #endif
87 #endif
88 .method("write", &Parser::FMTareaparser::write,
89 "@DocString(FMTareaparser::write)");
90 Rcpp::class_<Parser::FMTlandscapeparser>("FMTlandscapeparser","@DocString(FMTlandscapeparser)")
91 .constructor("@DocString(FMTlandscapeparser())")
92 .derives<Parser::FMTparser>("FMTparser")
94 "@DocString(FMTlandscapeparser::read)")
95 #ifdef FMTWITHGDAL
96 .method("readvectors", &Parser::FMTlandscapeparser::readvectors,
97 "@DocString(FMTlandscapeparser::readvectors)")
98 .method("readrasters",&Parser::FMTlandscapeparser::readrasters,
99 "@DocString(FMTlandscapeparser::readrasters)")
100 #endif
101 .method("write",&Parser::FMTlandscapeparser::write,
102 "@DocString(FMTlandscapeparser::write)");
103 Rcpp::class_<Parser::FMTactionparser>("FMTactionparser", "@DocString(FMTactionparser)")
104 .derives<Parser::FMTparser>("FMTparser")
105 .constructor("@DocString(FMTactionparser())")
106 .method("read",&Parser::FMTactionparser::read,
107 "@DocString(FMTactionparser::read)")
108 .method("write",&Parser::FMTactionparser::write,
109 "@DocString(FMTactionparser::write)");
110 Rcpp::class_<Parser::FMTtransitionparser>("FMTtransitionparser", "@DocString(FMTtransitionparser)")
111 .derives<Parser::FMTparser>("FMTparser")
112 .constructor("@DocString(FMTtransitionparser())")
113 .method("read",&Parser::FMTtransitionparser::read,
114 "@DocString(FMTtransitionparser::read)")
115 .method("write",&Parser::FMTtransitionparser::write,
116 "@DocString(FMTtransitionparser::write)");
117 Rcpp::class_<Parser::FMTconstantparser>("FMTconstantparser", "@DocString(FMTconstantparser)")
118 .derives<Parser::FMTparser>("FMTparser")
119 .constructor("@DocString(FMTconstantparser())")
120 .method("read",&Parser::FMTconstantparser::read,
121 "@DocString(FMTconstantparser::read)")
122 .method("write",&Parser::FMTconstantparser::write,
123 "@DocString(FMTconstantparser::write)");
124 Rcpp::class_<Parser::FMTlifespanparser>("FMTlifespanparser", "@DocString(FMTlifespanparser)")
125 .derives<Parser::FMTparser>("FMTparser")
126 .constructor("@DocString(FMTlifespanparser())")
127 .method("read",&Parser::FMTlifespanparser::read,
128 "@DocString(FMTlifespanparser::read)")
129 .method("write",&Parser::FMTlifespanparser::write,
130 "@DocString(FMTlifespanparser::write)");
131 Rcpp::class_<Parser::FMTyieldparser>("FMTyieldparser", "@DocString(FMTyieldparser)")
132 .derives<Parser::FMTparser>("FMTparser")
133 .constructor("@DocString(FMTyieldparser())")
134 .method("read",&Parser::FMTyieldparser::read,
135 "@DocString(FMTyieldparser::read)")
136 .method("write",&Parser::FMTyieldparser::write,
137 "@DocString(FMTyieldparser::write)");
138 Rcpp::class_<Parser::FMToutputparser>("FMToutputparser", "@DocString(FMToutputparser)")
139 .derives<Parser::FMTparser>("FMTparser")
140 .constructor("@DocString(FMToutputparser())")
141 .method("read",&Parser::FMToutputparser::read,
142 "@DocString(FMToutputparser::read)")
143 .method("addoutputs",&Parser::FMToutputparser::addoutputs,
144 "@DocString(FMToutputparser::addoutputs)")
145 .method("write",&Parser::FMToutputparser::write,
146 "@DocString(FMToutputparser::write)");
147 Rcpp::class_<Parser::FMToptimizationparser>("FMToptimizationparser", "@DocString(FMToptimizationparser)")
148 .derives<Parser::FMTparser>("FMTparser")
149 .constructor("@DocString(FMToptimizationparser())")
151 "@DocString(FMToptimizationparser::read)")
152 .method("write", &Parser::FMToptimizationparser::write,
153 "@DocString(FMToptimizationparser::write)");
154 Rcpp::class_<Parser::FMTmodelparser>("FMTmodelparser", "@DocString(FMTmodelparser)")
155 .derives<Parser::FMTparser>("FMTparser")
156 .constructor("@DocString(FMTmodelparser())")
157 .method("read",&Parser::FMTmodelparser::read,
158 "@DocString(FMTmodelparser::read)")
159 .method("readproject", &Parser::FMTmodelparser::readproject,
160 "@DocString(FMTmodelparser::readproject)")
161 .method("readschedules", &Parser::FMTmodelparser::readschedules,
162 "@DocString(FMTmodelparser::readschedules)")
163 .method("write",&Parser::FMTmodelparser::write,
164 "@DocString(FMTmodelparser::write)");
165 Rcpp::class_<Parser::FMTscheduleparser>("FMTscheduleparser", "@DocString(FMTscheduleparser)")
166 .derives<Parser::FMTparser>("FMTparser")
167 .constructor("@DocString(FMTscheduleparser())")
168 .method("read",&Parser::FMTscheduleparser::read,
169 "@DocString(FMTscheduleparser::read)")
170 .method("write",&Parser::FMTscheduleparser::write,
171 "@DocString(FMTscheduleparser::write)");
172 }
173
174}
175
176#endif // PYEXPORTParser_H_INCLUDED
RCPP_EXPOSED_AS(Parser::FMTparser)
RCPP_EXPOSED_WRAP(Parser::FMTparser)
Definition: FMTobject.hpp:50
Definition: FMTactionparser.hpp:33
std::vector< Core::FMTaction > read(const std::vector< Core::FMTtheme > &themes, const Core::FMTyields &yields, const Core::FMTconstants &constants, const std::string &location)
void write(const std::vector< Core::FMTaction > &actions, const std::string &location, bool withgcbmagg=false) const
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
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
std::vector< Core::FMTactualdevelopment > read(const std::vector< Core::FMTtheme > &themes, const Core::FMTconstants &constants, const std::string &location)
void write(const std::vector< Core::FMTactualdevelopment > &areas, const std::string &location) const
void vectorfieldtoraster(const std::string &data_vectors, const std::string &tifpathandname, const int &resolution, const std::string &field, bool fittoforel=true) 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< 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: FMTconstantparser.hpp:27
Core::FMTconstants read(const std::string &location)
void write(const Core::FMTconstants &constants, const std::string &location) const
Definition: FMTlandscapeparser.hpp:36
std::vector< Core::FMTtheme > readrasters(const std::vector< std::string > &locations)
std::vector< Core::FMTtheme > readvectors(const std::string &location)
void write(const std::vector< Core::FMTtheme > &themes, const std::string &location) const
std::vector< Core::FMTtheme > read(const Core::FMTconstants &constants, const std::string &location)
Definition: FMTlifespanparser.hpp:30
void write(const Core::FMTlifespans &lifespan, const std::string &location) const
Core::FMTlifespans read(const std::vector< Core::FMTtheme > &themes, const Core::FMTconstants &constants, const std::string &location)
Definition: FMTmodelparser.hpp:51
void write(const Models::FMTmodel &model, const std::string &folder) const
std::vector< Models::FMTmodel > readproject(const std::string &primary_location, std::vector< std::string >scenarios=std::vector< std::string >(), bool readarea=true, bool readoutputs=true, bool readoptimize=true)
Models::FMTmodel read(const std::string &con, const std::string &lan, const std::string &lif, const std::string &are, const std::string &yld, const std::string &act, const std::string &tr, const std::string &out, std::string opt=std::string())
std::vector< std::vector< Core::FMTschedule > > readschedules(const std::string &primary_location, const std::vector< Models::FMTmodel > &models)
Definition: FMToptimizationparser.hpp:44
std::vector< Core::FMTconstraint > read(const std::vector< Core::FMTtheme > &themes, const std::vector< Core::FMTaction > &actions, const Core::FMTconstants &constants, const std::vector< Core::FMToutput > &outputs, std::vector< Core::FMTaction > &excluded, const std::string &location)
void write(const std::vector< Core::FMTconstraint > &constraints, const std::string &location) const
Definition: FMToutputparser.hpp:35
std::vector< Core::FMToutput > addoutputs(const std::vector< Core::FMToutput > oldoutputs, const std::vector< Core::FMTtheme > &themes, const std::vector< Core::FMTaction > &actions, const Core::FMTyields &ylds, const Core::FMTconstants &constants, const std::string &location, std::vector< std::string > outputsnames=std::vector< std::string >())
std::vector< Core::FMToutput > read(const std::vector< Core::FMTtheme > &themes, const std::vector< Core::FMTaction > &actions, const Core::FMTyields &ylds, const Core::FMTconstants &constants, const std::string &location)
void write(const std::vector< Core::FMToutput > &outputs, const std::string &location) const
Definition: FMTparser.hpp:66
Definition: FMTscheduleparser.hpp:30
std::vector< Core::FMTschedule > read(const std::vector< Core::FMTtheme > &themes, const std::vector< Core::FMTaction > &actions, const std::string &location, double tolerance=FMT_DBL_TOLERANCE)
void write(const std::vector< Core::FMTschedule > &schedules, const std::string &location) const
Definition: FMTtransitionparser.hpp:36
void write(const std::vector< Core::FMTtransition > &transitions, const std::string &location) const
std::vector< Core::FMTtransition > read(const std::vector< Core::FMTtheme > &themes, const std::vector< Core::FMTaction > &actions, const Core::FMTyields &ylds, const Core::FMTconstants &constants, const std::string &location)
Definition: FMTyieldparser.hpp:40
void write(const Core::FMTyields &yields, const std::string &location) const
Core::FMTyields read(const std::vector< Core::FMTtheme > &themes, const Core::FMTconstants &constants, const std::string &location)
Definition: RexportCore.hpp:153
void exportParser()
Definition: RexportParser.hpp:58