Skip to content

Commit

Permalink
Merge pull request #86 from traveltime-dev/2023-11_fix-85
Browse files Browse the repository at this point in the history
fix #85: add new transporation type cycling+public_transport
  • Loading branch information
olivierdalang authored Dec 22, 2023
2 parents d90fa72 + 14135ef commit b4bc518
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
13 changes: 0 additions & 13 deletions travel_time_platform_plugin/algorithms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
31 changes: 17 additions & 14 deletions travel_time_platform_plugin/algorithms/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"),
)
Expand Down

0 comments on commit b4bc518

Please sign in to comment.