| 24 | }; |
| 25 | |
| 26 | return_code parseArguments(int argc, |
| 27 | char *argv[], |
| 28 | std::string &verbosity, |
| 29 | extractor::ExtractorConfig &extractor_config) |
| 30 | { |
| 31 | // declare a group of options that will be allowed only on command line |
| 32 | boost::program_options::options_description generic_options("Options"); |
| 33 | generic_options.add_options()("version,v", "Show version")("help,h", "Show this help message")( |
| 34 | "list-inputs", "List required and optional input file extensions")( |
| 35 | "verbosity,l", |
| 36 | boost::program_options::value<std::string>(&verbosity)->default_value("INFO"), |
| 37 | std::string("Log verbosity level: " + util::LogPolicy::GetLevels()).c_str()); |
| 38 | |
| 39 | // declare a group of options that will be allowed both on command line |
| 40 | boost::program_options::options_description config_options("Configuration"); |
| 41 | config_options.add_options()( |
| 42 | "profile,p", |
| 43 | boost::program_options::value<std::filesystem::path>(&extractor_config.profile_path) |
| 44 | ->default_value("profiles/car.lua"), |
| 45 | "Path to LUA routing profile")( |
| 46 | "data_version,d", |
| 47 | boost::program_options::value<std::string>(&extractor_config.data_version) |
| 48 | ->default_value(""), |
| 49 | "Data version. Leave blank to avoid. osmosis - to get timestamp from file")( |
| 50 | "threads,t", |
| 51 | boost::program_options::value<unsigned int>(&extractor_config.requested_num_threads) |
| 52 | ->default_value(std::thread::hardware_concurrency()), |
| 53 | "Number of threads to use")( |
| 54 | "small-component-size", |
| 55 | boost::program_options::value<unsigned int>(&extractor_config.small_component_size) |
| 56 | ->default_value(1000), |
| 57 | "Number of nodes required before a strongly-connected-componennt is considered big " |
| 58 | "(affects nearest neighbor snapping)")( |
| 59 | "with-osm-metadata", |
| 60 | boost::program_options::bool_switch(&extractor_config.use_metadata) |
| 61 | ->implicit_value(true) |
| 62 | ->default_value(false), |
| 63 | "Use metadata during osm parsing (This can affect the extraction performance).")( |
| 64 | "parse-conditional-restrictions", |
| 65 | boost::program_options::bool_switch(&extractor_config.parse_conditionals) |
| 66 | ->implicit_value(true) |
| 67 | ->default_value(false), |
| 68 | "Save conditional restrictions found during extraction to disk for use " |
| 69 | "during contraction")("location-dependent-data", |
| 70 | boost::program_options::value<std::vector<std::filesystem::path>>( |
| 71 | &extractor_config.location_dependent_data_paths) |
| 72 | ->composing(), |
| 73 | "GeoJSON files with location-dependent data")( |
| 74 | "disable-location-cache", |
| 75 | boost::program_options::bool_switch(&extractor_config.use_locations_cache) |
| 76 | ->implicit_value(false) |
| 77 | ->default_value(true), |
| 78 | "Use internal nodes locations cache for location-dependent data lookups")( |
| 79 | "dump-nbg-graph", |
| 80 | boost::program_options::bool_switch(&extractor_config.dump_nbg_graph) |
| 81 | ->implicit_value(true) |
| 82 | ->default_value(false), |
| 83 | "Dump raw node-based graph to *.osrm file for debug purposes.")( |