src/tools/lvr2_hdf5togeotiff/Options.cpp
Go to the documentation of this file.
1 
31 #include <boost/filesystem/operations.hpp>
32 
33 #include "Options.hpp"
34 
35 namespace hdf5togeotiff
36 {
37  Options::Options(int argc, char **argv) : m_descr("Supported options")
38  {
39  // Create option descriptions
40 
41  m_descr.add_options()
42  ("help", "Produce help message")
43  ("h5", value<string>()->default_value(""), "Input HDF5 dataset containing hyperspectral data.")
44  ("gtif", value<string>()->default_value("gtif.tif"), "Output GeoTIFF raster dataset containing hyperspectral data.")
45  ("min", value<size_t>()->default_value(0), "Minimum hyperspectral band to be included in conversion.")
46  ("max", value<size_t>()->default_value(UINT_MAX), "Maximum hyperspectral band to be included in conversion.")
47  ("pos", value<string>()->default_value("00000"), "5 character identification code of scan position to be converted.");
48 
49  // Parse command line and generate variables map
50  store(command_line_parser(argc, argv).options(m_descr).positional(m_pdescr).run(), m_variables);
51  notify(m_variables);
52 
53  if(
54  m_variables.count("help")
55  || m_variables["pos"].as<string>().length() != 5
56  || m_variables["min"].as<size_t>() < 0
57  || m_variables["max"].as<size_t>() <= m_variables["min"].as<size_t>()
58  || !boost::filesystem::exists(boost::filesystem::path(m_variables["h5"].as<string>()))
59  )
60  {
61  ::std::cout << m_descr << ::std::endl;
62  exit(-1);
63  }
64 
65  }
66 
68 } // namespace hdf5togeotiff
const kaboom::Options * options
variables_map m_variables
The internally used variable map.
positional_options_description m_pdescr
The internally used positional option description.
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
options_description m_descr
The internally used option description.
char ** argv


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08