-
Notifications
You must be signed in to change notification settings - Fork 0
/
route_comparison.py
43 lines (35 loc) · 1.1 KB
/
route_comparison.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Comparison of green and short routes using openrouteservice"""
__author__ = "Christina Ludwig, GIScience Research Group, Heidelberg University"
__email__ = "[email protected]"
import argparse
import sys
from modules.mapmatching import mapmatching
from modules.utils import load_config, init_logger
from modules.routing import generate_routes
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Comparison of short and green routes using openrouteservice"
)
parser.add_argument(
"--config",
"-c",
required=True,
dest="config_file",
type=str,
help="Configuration file",
)
args = parser.parse_args()
logger = init_logger("comparison")
config = load_config(args.config_file)
try:
generate_routes(config)
except Exception:
logger.exception("Error during simulation of routes:")
sys.exit(1)
try:
mapmatching(config)
except Exception:
logger.exception("Error during map matching:")
sys.exit(1)