diff --git a/emission/analysis/classification/inference/mode/rule_engine.py b/emission/analysis/classification/inference/mode/rule_engine.py index 837364a1d..95b825bd8 100644 --- a/emission/analysis/classification/inference/mode/rule_engine.py +++ b/emission/analysis/classification/inference/mode/rule_engine.py @@ -219,7 +219,7 @@ def collapse_modes(section_entry, modes): if len(unique_modes) == 1: return list(unique_modes)[0] - supported_modes = set(['BUS', 'TRAIN', 'LIGHT_RAIL', 'SUBWAY', 'TRAM']) + supported_modes = set(['BUS', 'TRAIN', 'LIGHT_RAIL', 'SUBWAY', 'TRAM', 'TROLLEYBUS']) if not unique_modes.issubset(supported_modes): logging.error("unique_modes = %s, but we support only %s" % diff --git a/emission/core/wrapper/modeprediction.py b/emission/core/wrapper/modeprediction.py index 853dcb82b..7b436b203 100644 --- a/emission/core/wrapper/modeprediction.py +++ b/emission/core/wrapper/modeprediction.py @@ -25,6 +25,7 @@ class PredictedModeTypes(enum.Enum): SUBWAY = 7 TRAM = 8 LIGHT_RAIL = 9 + TROLLEYBUS = 10 class Modeprediction(ecwb.WrapperBase): props = {"trip_id": ecwb.WrapperBase.Access.WORM, # the trip that this is part of diff --git a/emission/net/ext_service/transit_matching/match_stops.py b/emission/net/ext_service/transit_matching/match_stops.py index d08505e9e..bce697622 100644 --- a/emission/net/ext_service/transit_matching/match_stops.py +++ b/emission/net/ext_service/transit_matching/match_stops.py @@ -295,6 +295,8 @@ def extract_railway_modes(stop): p_modes.append("TRAM") if "light_rail" in stop: p_modes.append("LIGHT_RAIL") + if "trolleybus" in stop: + p_modes.append("TROLLEYBUS") logging.debug("After extracting data from tags, potential modes = %s" % [p for p in p_modes])