diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c4b19c027..0d141358bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ * CHANGED: date_time refactor as a preparation to return DST/timezone related offset in the response [#4365](https://github.com/valhalla/valhalla/pull/4365) * ADDED: find connection on backward search for bidir matrix algo [#4329](https://github.com/valhalla/valhalla/pull/4329) * FIXED: Fix segfault in OSRM serializer with bannerInstructions when destination is on roundabout [#4480](https://github.com/valhalla/valhalla/pull/4481) + * CHANGED: Adujustment of walk speed when walking on slight downhill [#4302](https://github.com/valhalla/valhalla/pull/4302) ## Release Date: 2023-05-11 Valhalla 3.4.0 * **Removed** diff --git a/src/sif/pedestriancost.cc b/src/sif/pedestriancost.cc index 1892a85f62..9ff6d35c5e 100644 --- a/src/sif/pedestriancost.cc +++ b/src/sif/pedestriancost.cc @@ -186,14 +186,24 @@ const BaseCostingOptionsConfig kBaseCostOptsConfig = GetBaseCostOptsConfig(); // instead up the values of ascent/descent, e.g. 400/800 better matches // intermediate hikers. This will bring the uphill values quite close to the // ones from the exponential while still keeping downhill speed below flat speed. +// +// For negative angles (downhill), as per DIN 33466, speed decreases rapidly +// as the slope becomes steeper. This behavior may hold true for mountain hikers +// due to unpaved paths. However, it contradicts common sense for city walkers +// when the speed factor drops below 1.0 (the walking speed on flat terrain) +// even on a slight downhill slope. To address this, we employ a modified Tobler's +// function to correct the factor for negative angles. Consequently, walk speed +// slightly increases (faster than on flat terrain) when the angle is between +// 0% and -5%, and then decreases as indicated by DIN 33466. +// see https://gist.github.com/xlqian/0b25c8db6f45fb2c8bf68494e1ea54f1 constexpr float kGradeBasedSpeedFactor[] = { - 1.40f, // -10.0% - 0.67 - 1.32f, // -8.0% - 0.73 - 1.26f, // -6.5% - 0.77 - 1.20f, // -5.0% - 0.82 - 1.12f, // -3.0% - 0.89 - 1.06f, // -1.5% - 0.94 + 1.33f, // -10.0% - 0.67 + 1.22f, // -8.0% - 0.73 + 1.08f, // -6.5% - 0.77 + 0.97f, // -5.0% - 0.82 + 0.88f, // -3.0% - 0.89 + 0.92f, // -1.5% - 0.94 1.00f, // 0.0% - 1.00 1.10f, // 1.5% - 1.06 1.20f, // 3.0% - 1.13