diff options
author | VladiMihaylenko <vxmihaylenko@gmail.com> | 2018-09-03 18:34:08 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2018-09-13 13:43:03 +0300 |
commit | 7d757db649d952160e7bf608ec84345e5362905a (patch) | |
tree | 7c01afdd2ac18f85917c2a7c5db1ec48b499c304 /track_generator/track_generator_tool.cpp | |
parent | 165028d073eb6bf69257b6be00d5b29696aeccaa (diff) |
Track generator tool
Diffstat (limited to 'track_generator/track_generator_tool.cpp')
-rw-r--r-- | track_generator/track_generator_tool.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/track_generator/track_generator_tool.cpp b/track_generator/track_generator_tool.cpp new file mode 100644 index 0000000000..d9ba7f4b7b --- /dev/null +++ b/track_generator/track_generator_tool.cpp @@ -0,0 +1,49 @@ +#include "track_generator/utils.hpp" + +#include "routing/vehicle_mask.hpp" + +#include "base/assert.hpp" +#include "base/logging.hpp" + +#include <string> + +#include "3party/gflags/src/gflags/gflags.h" + +DEFINE_string(inputDir, "", "Path to kmls."); + +DEFINE_string(outputDir, "", "Path to converted kmls."); + +DEFINE_int32(vehicleType, 0, "Numeric value of routing::VehicleType enum. " + "Pedestrian by default."); + +DEFINE_bool(showHelp, false, "Show help on all flags."); + +int main(int argc, char ** argv) +{ + google::SetUsageMessage("The tool is used to generate more smooth track based on " + "waypoints from the kml. The kml has to contain points " + "within LineString tag. If the router can't build the route " + "than the specific path will be untouched. Multiple kmls into " + " the directory are supported.\n\n" + "Usage example: " + "./track_generator_tool -cmd=generate -inputDir=path/to/input/ -outputDir=/path/to/output"); + + google::ParseCommandLineFlags(&argc, &argv, true /* remove_flags */); + + if (argc == 1 || FLAGS_showHelp) + { + google::ShowUsageWithFlags(argv[0]); + return 0; + } + + if (FLAGS_inputDir.empty() || FLAGS_outputDir.empty()) + { + LOG(LINFO, (FLAGS_inputDir.empty() ? "Input" : "Output", "directory is required.")); + google::ShowUsageWithFlags(argv[0]); + return 1; + } + + track_generator_tool::GenerateTracks(FLAGS_inputDir, FLAGS_outputDir, + static_cast<routing::VehicleType>(FLAGS_vehicleType)); + return 0; +} |