diff --git a/travel_time_platform_plugin/algorithms/base.py b/travel_time_platform_plugin/algorithms/base.py index 91e3e7c..acd8412 100644 --- a/travel_time_platform_plugin/algorithms/base.py +++ b/travel_time_platform_plugin/algorithms/base.py @@ -27,19 +27,6 @@ from ..utils import log, throttler, tr EPSG4326 = QgsCoordinateReferenceSystem("EPSG:4326") -TRANSPORTATION_TYPES = [ - "cycling", - "driving", - "driving+train", - "public_transport", - "walking", - "coach", - "bus", - "train", - "ferry", - "driving+ferry", - "cycling+ferry", -] THROTTLING_PER_SETTINGS = "PER_SETTINGS" THROTTLING_DISABLED = "DISABLED" THROTTLING_STRATEGIES = [THROTTLING_PER_SETTINGS, THROTTLING_DISABLED] diff --git a/travel_time_platform_plugin/algorithms/simple.py b/travel_time_platform_plugin/algorithms/simple.py index 07dc8e1..6822840 100644 --- a/travel_time_platform_plugin/algorithms/simple.py +++ b/travel_time_platform_plugin/algorithms/simple.py @@ -17,19 +17,22 @@ from .advanced import RoutesAlgorithm, TimeFilterAlgorithm, TimeMapAlgorithm from .base import THROTTLING_PER_SETTINGS, THROTTLING_STRATEGIES, AlgorithmBase -TRANSPORTATION_TYPES = [ - "cycling", - "driving", - "driving+train", - "public_transport", - "walking", - "coach", - "bus", - "train", - "ferry", - "driving+ferry", - "cycling+ferry", -] +TRANSPORTATION_TYPES_DICT = { + "cycling": "cycling", + "driving": "driving", + "driving+train": "driving+train", + "public_transport": "public_transport", + "cycling+public_transport": "cycling+public_transport (only in Netherlands)", + "walking": "walking", + "coach": "coach", + "bus": "bus", + "train": "train", + "ferry": "ferry", + "driving+ferry": "driving+ferry", + "cycling+ferry": "cycling+ferry", +} +TRANSPORTATION_TYPES = list(TRANSPORTATION_TYPES_DICT.keys()) +TRANSPORTATION_TYPES_LABELS = list(TRANSPORTATION_TYPES_DICT.values()) SEARCH_TYPES = [ "DEPARTURE", "ARRIVAL", @@ -72,7 +75,7 @@ def initAlgorithm(self, config): QgsProcessingParameterEnum( "INPUT_TRNSPT_TYPE", tr("Transportation type"), - options=TRANSPORTATION_TYPES, + options=TRANSPORTATION_TYPES_LABELS, # TODO: not the best default defaultValue=TRANSPORTATION_TYPES.index("cycling"), )