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
hdf5togeotiff::Options::Options
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
Definition: src/tools/lvr2_hdf5togeotiff/Options.cpp:37
Options.hpp
hdf5togeotiff::Options::m_variables
variables_map m_variables
The internally used variable map.
Definition: src/tools/lvr2_hdf5togeotiff/Options.hpp:42
hdf5togeotiff::Options::m_descr
options_description m_descr
The internally used option description.
Definition: src/tools/lvr2_hdf5togeotiff/Options.hpp:45
options
const kaboom::Options * options
Definition: src/tools/lvr2_kaboom/Main.cpp:45
hdf5togeotiff
Definition: src/tools/lvr2_hdf5togeotiff/Options.cpp:35
argc
int argc
Definition: tests_high_five_parallel.cpp:27
hdf5togeotiff::Options::~Options
virtual ~Options()
Definition: src/tools/lvr2_hdf5togeotiff/Options.cpp:67
hdf5togeotiff::Options::m_pdescr
positional_options_description m_pdescr
The internally used positional option description.
Definition: src/tools/lvr2_hdf5togeotiff/Options.hpp:48
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28


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 Wed Mar 2 2022 00:37:24