forked from stefanschramm/osm_oepnv_validator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
122 lines (117 loc) · 4.11 KB
/
config.py
File metadata and controls
122 lines (117 loc) · 4.11 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import rulesets.berlin
import rulesets.hiking
import rulesets.bicycle
import rulesets.power
import rulesets.other
script_path = os.path.dirname(__file__)
output_dir = script_path + "/output"
data_dir = script_path + "/data"
template_dir = script_path + "/templates"
profiles = {
'berlin_oepnv': {
'shortname': 'berlin_oepnv',
'name': u"Berlin: ÖPNV (only BVG and S-Bahn Berlin GmbH)",
'rules': rulesets.berlin.PublicTransportBerlin,
'filter': lambda r: "network" in r[1] \
and r[1]["network"] == "VBB" \
and "operator" in r[1] \
and (r[1]["operator"] == "BVG" or r[1]["operator"] == "S-Bahn Berlin GmbH") \
and "type" in r[1] \
and r[1]["type"] in ["route", "route_master"],
'filter_text': 'All route and route_master relations with network=VBB and (operator=BVG or operator=S-Bahn Berlin GmbH)',
'datasource': 'berlin.osm.pbf',
'stopplan': True,
'maps': {
# 'internal name': ('readable name', filter function)
'sunetz': ("S+U-Bahn", rulesets.berlin.is_s_or_u_bahn),
'strassenbahn': (u"Straßenbahn (no MetroTram)", rulesets.berlin.is_normal_tram),
'metrotram': ("MetroTram", rulesets.berlin.is_metro_tram),
'bus': ("Bus (no Metro- or ExpressBus)", rulesets.berlin.is_normal_bus),
'metrobus': ("MetroBus", rulesets.berlin.is_metro_bus),
'expressbus': ("ExpressBus", rulesets.berlin.is_express_bus)
}
},
'berlin_vbb': {
'shortname': 'berlin_vbb',
'name': u"Berlin: VBB (without BVG and S-Bahn Berlin GmbH)",
'rules': rulesets.berlin.PublicTransportBerlin,
'filter': lambda r: \
"network" in r[1] \
and r[1]["network"] == "VBB" \
and "type" in r[1] \
and r[1]["type"] in ["route", "route_master"]
and (not "operator" in r[1] or r[1]["operator"] not in ["BVG", "S-Bahn Berlin GmbH"]),
'datasource': 'berlin.osm.pbf',
'stopplan': True,
'maps': {
'all': ("alle Linien", lambda r: True)
}
},
'berlin_bicycle': {
'shortname': 'berlin_bicycle',
'name': 'Berlin: Bicycle Routes',
'rules': rulesets.bicycle.Bicycle,
'filter': lambda r: "type" in r[1] \
and r[1]["type"] in ["route", "route_master"] \
and (("route" in r[1] and r[1]["route"] == "bicycle") \
or ("route_master" in r[1] and r[1]["route_master"] == "bicycle")),
'datasource': 'berlin.osm.pbf',
'stopplan': False,
'maps': {}
},
'berlin_hiking': {
'shortname': 'berlin_hiking',
'name': 'Berlin: Hiking Routes',
'rules': rulesets.hiking.Hiking,
'filter': lambda r: "type" in r[1] \
and r[1]["type"] in ["route", "route_master"] \
and (("route" in r[1] and r[1]["route"] == "hiking") \
or ("route_master" in r[1] and r[1]["route_master"] == "hiking")),
'datasource': 'berlin.osm.pbf',
'stopplan': False,
'maps': {}
},
'berlin_power': {
'shortname': 'berlin_power',
'name': 'Berlin: Powerlines',
'rules': rulesets.power.Power,
'filter': lambda r: "type" in r[1] \
and r[1]["type"] in ["route", "route_master"] \
and (("route" in r[1] and r[1]["route"] == "power") \
or ("route_master" in r[1] and r[1]["route_master"] == "power")),
'datasource': 'berlin.osm.pbf',
'stopplan': False,
'maps': {}
},
'berlin_other': {
'shortname': 'berlin_other',
'name': 'Berlin: other (no VBB, no hiking routes, no bicycle routes, no powerlines)',
'rules': rulesets.other.Other,
'filter': lambda r: ("network" not in r[1] \
or r[1]["network"] != "VBB") \
and "type" in r[1] \
and r[1]["type"] in ["route", "route_master"] \
and not( \
(("route" in r[1] and r[1]["route"] in ["hiking", "bicycle", "power"]) \
or ("route_master" in r[1] and r[1]["route_master"] in ["hiking", "bicycle", "power"]))
),
'datasource': 'berlin.osm.pbf',
'stopplan': False,
'maps': {}
}
# 'germany_power': {
# 'shortname': 'germany_power',
# 'name': 'Germany: Powerlines',
# 'rules': rulesets.power.Power,
# 'filter': lambda r: "type" in r[1] \
# and r[1]["type"] in ["route", "route_master"] \
# and (("route" in r[1] and r[1]["route"] == "power") \
# or ("route_master" in r[1] and r[1]["route_master"] == "power")),
# 'datasource': 'germany.osm.pbf',
# 'stopplan': False,
# 'maps': {}
# }
}