Add better ferry handling
This commit is contained in:
parent
666c78ff59
commit
30266e72d2
6 changed files with 69 additions and 10 deletions
35
Profiles/general/ferry_speed.json
Normal file
35
Profiles/general/ferry_speed.json
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "ferry_speed",
|
||||
"description": "Gives the expected speed for a ferry. This includes the time needed to board and the expected waiting time (if duration is present). This uses the tag '_length', which is expected to be added by the preprocessing-step.",
|
||||
"unit": "km/h",
|
||||
"value": {
|
||||
"$ifDotted": {
|
||||
"route": {
|
||||
"ferry": "yes"
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"#": "(length (m) / (duration (minutes) + 5 minutes slack)) * 0.06 minutes/kilometer",
|
||||
"$multiply": [
|
||||
{
|
||||
"#": "The default value is chosen so that it defaults to 1km/h",
|
||||
"$default": 83.33333333333333,
|
||||
"value": {
|
||||
"_length": "$parse"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$inv": {
|
||||
"$sum": [
|
||||
{
|
||||
"duration": "$parse"
|
||||
},
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
0.06
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
5
Profiles/general/ferry_speed.test.csv
Normal file
5
Profiles/general/ferry_speed.test.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
expected,route,duration,interval,_length,comment
|
||||
1,ferry,,,
|
||||
2,ferry,25,,1000,25 minutes duration + 5 minutes to get on is 30 minutes total for one kilometer -> 2 km/h
|
||||
4,ferry,10,,1000,10 minutes duration + 5 minutes to get on is 15 minutes total for one kilometer -> 4km/h
|
||||
null,,,,Ferry is not set
|
|
|
@ -7,8 +7,7 @@
|
|||
"$firstMatchOf": [
|
||||
"maxspeed",
|
||||
"designation",
|
||||
"highway",
|
||||
"route"
|
||||
"highway"
|
||||
],
|
||||
"value": {
|
||||
"maxspeed": "$parse",
|
||||
|
@ -37,10 +36,6 @@
|
|||
},
|
||||
"designation": {
|
||||
"towpath": 30
|
||||
},
|
||||
"route": {
|
||||
"#": "A ferry often goes once every half-an-hour, to cross like 100m; in other words: 0.2km/h",
|
||||
"ferry": 0.2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue