Fast map matching  0.1.0
result_config.hpp
1 
9 #ifndef FMM_SRC_CONFIG_RESULT_CONFIG_HPP_
10 #define FMM_SRC_CONFIG_RESULT_CONFIG_HPP_
11 
12 #include <string>
13 #include <set>
14 #include "cxxopts/cxxopts.hpp"
15 #include <boost/property_tree/ptree.hpp>
16 #include <boost/property_tree/xml_parser.hpp>
17 
18 namespace FMM {
19 
20 namespace CONFIG {
21 
25 struct OutputConfig {
26  bool write_opath = false;
28  bool write_offset = false;
30  bool write_error = false;
32  bool write_cpath = true;
34  bool write_tpath = false;
37  bool write_mgeom = true;
39  bool write_spdist = false;
42  bool write_pgeom = false;
44  bool write_ep = false;
46  bool write_tp = false;
48  bool write_length = false;
50 };
51 
55 struct ResultConfig {
56  std::string file;
62  bool validate() const;
66  void print() const;
75  static std::set<std::string> string2set(const std::string &s);
82  const boost::property_tree::ptree &xml_data);
89  const cxxopts::ParseResult &arg_data);
90 };
91 }
92 
93 }
94 
95 #endif //FMM_SRC_CONFIG_RESULT_CONFIG_HPP_
FMM::CONFIG::ResultConfig::load_from_xml
static ResultConfig load_from_xml(const boost::property_tree::ptree &xml_data)
Load result configuration data from xml file.
Definition: result_config.cpp:35
FMM::CONFIG::OutputConfig::write_tpath
bool write_tpath
if true, tpath (the path traversed between each two consecutive observations) will be exported
Definition: result_config.hpp:34
FMM::CONFIG::OutputConfig::write_ep
bool write_ep
if true, ep (emission proability of each point) will be exported
Definition: result_config.hpp:44
FMM::CONFIG::ResultConfig::validate
bool validate() const
Check the validation of the configuration.
Definition: result_config.cpp:164
FMM::CONFIG::OutputConfig::write_spdist
bool write_spdist
if true, spdist (the distance traversed between each two consecutive points) will be exported
Definition: result_config.hpp:39
FMM::CONFIG::OutputConfig::write_tp
bool write_tp
if true, tp (transition probability) will be exported
Definition: result_config.hpp:46
FMM::CONFIG::ResultConfig::output_config
OutputConfig output_config
Output fields to export.
Definition: result_config.hpp:57
FMM::CONFIG::OutputConfig::write_length
bool write_length
if true, length (length of each matched edge) will be exported
Definition: result_config.hpp:48
FMM::CONFIG::ResultConfig::file
std::string file
Output file to write the result.
Definition: result_config.hpp:56
FMM
Fast map matching.
Definition: geom_algorithm.hpp:17
FMM::CONFIG::OutputConfig::write_mgeom
bool write_mgeom
if true, mgeom (the geometry of the matched path) will be exported
Definition: result_config.hpp:37
FMM::CONFIG::ResultConfig::string2set
static std::set< std::string > string2set(const std::string &s)
Parse a string separated by , into a set of strings.
Definition: result_config.cpp:153
FMM::CONFIG::OutputConfig::write_cpath
bool write_cpath
if true, cpath (a list of edge ID representing the matched path) will be exported
Definition: result_config.hpp:32
FMM::CONFIG::OutputConfig::write_opath
bool write_opath
if true, opath (edge id matched for each point) will be exported
Definition: result_config.hpp:26
FMM::CONFIG::ResultConfig
Result Configuration class, defining output file and output fields.
Definition: result_config.hpp:55
FMM::CONFIG::OutputConfig::write_error
bool write_error
if true, gps error (distance from GPS point to the matched point) will be exported
Definition: result_config.hpp:30
FMM::CONFIG::ResultConfig::print
void print() const
Print the configuration information.
Definition: result_config.cpp:6
FMM::CONFIG::OutputConfig
Output configuration class defining the fields exported for map matching.
Definition: result_config.hpp:25
FMM::CONFIG::ResultConfig::load_from_arg
static ResultConfig load_from_arg(const cxxopts::ParseResult &arg_data)
Load result configuration from argument data.
Definition: result_config.cpp:94
FMM::CONFIG::OutputConfig::write_pgeom
bool write_pgeom
if true, pgeom (a linestring connecting the matched point) will be exported
Definition: result_config.hpp:42
FMM::CONFIG::OutputConfig::write_offset
bool write_offset
if true, offset (distance to the start point of a matched edge) will be exported
Definition: result_config.hpp:28