Welcome to mirror list, hosted at ThFree Co, Russian Federation.

track_generator_tool.cpp « track_generator - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d9ba7f4b7b1171e7868539263a018368fdca5411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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;
}