@@ -212,7 +212,11 @@ def get_stations(station):
212
212
def get_route (start , dest ,
213
213
time = None , arrival_time = False ,
214
214
max_walk_time_to_start = None , max_walk_time_to_dest = None ,
215
- change_limit = None ):
215
+ change_limit = None ,
216
+ ubahn = True ,
217
+ bus = True ,
218
+ tram = True ,
219
+ sbahn = True ):
216
220
"""Plans a route from start to dest
217
221
218
222
Change in 1.3.2: accepts both 'old-style' integer IDs which were used
@@ -233,6 +237,14 @@ def get_route(start, dest,
233
237
Maximum time of walking in minutes required to reach the start/dest.
234
238
changeLimit : int, optional
235
239
Specifies the maximum amount of changes.
240
+ ubahn: bool, optional
241
+ Specifies if the subway(UBahn) should be considered in the route
242
+ bus: bool, optional
243
+ Specifies if the bus should be considered in the route
244
+ tram: bool, optional
245
+ Specifies if the tram should be considered in the route
246
+ sbahn: bool, optional
247
+ Specifies if the SBahn should be considered in the route
236
248
"""
237
249
url = routing_url
238
250
options = []
@@ -279,6 +291,15 @@ def get_route(start, dest,
279
291
if isinstance (change_limit , int ):
280
292
options .append ("changeLimit=" + str (change_limit ))
281
293
294
+ if not ubahn :
295
+ options .append ("transportTypeUnderground=false" )
296
+ if not bus :
297
+ options .append ("transportTypeBus=false" )
298
+ if not tram :
299
+ options .append ("transportTypeTram=false" )
300
+ if not sbahn :
301
+ options .append ("transportTypeSBahn=false" )
302
+
282
303
options_url = "&" .join (options )
283
304
url = routing_url + options_url
284
305
results = _perform_api_request (url )
0 commit comments