Skip to content

Commit 77ac3d9

Browse files
committed
fix the mode list construction bug
1 parent cc83151 commit 77ac3d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pymmrouting/routeplanner.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,15 @@ def refine_results(self, results):
142142
for r in results['routes']:
143143
if r['existence'] == False:
144144
continue
145-
modes = [f['properties']['mode'] for f in r['geojson']['features']]
145+
modes = [f['properties']['mode']
146+
for f in r['geojson']['features']
147+
if f['properties']['type'] == 'path']
146148
pt_modes = ['suburban', 'underground', 'tram', 'bus']
147149
# Eliminate the result claiming using public transit but actually
148150
# does not
149151
if not (set(modes).isdisjoint(set(pt_modes))):
150152
# Claim using public transit
151-
real_switch_types = [sp['properties']['type'] for sp in r['switch_points']]
153+
real_switch_types = [sp['properties']['switch_type'] for sp in r['switch_points']]
152154
pt_switch_types = ['suburban_station',
153155
'underground_station',
154156
'tram_station',

0 commit comments

Comments
 (0)