Merge pull request #500 from quaelnix/elevation-filter-regression-fix

Fix regression in elevation filter logic
This commit is contained in:
afischerdev 2023-02-15 17:21:19 +01:00 committed by GitHub
commit c588daa68f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -772,16 +772,15 @@ public class RoutingEngine extends Thread {
if (ele_last != Short.MIN_VALUE) { if (ele_last != Short.MIN_VALUE) {
ehb = ehb + (ele_last - ele) * eleFactor; ehb = ehb + (ele_last - ele) * eleFactor;
} }
if (ehb > 10.) { if (ehb > 0) {
ascend += ehb - 10.; ascend += ehb;
ehb = 10.; ehb = 0;
} else if (ehb < 0.) { } else if (ehb < -10) {
ehb = 0.; ehb = -10;
} }
} }
} }
ascend += ehb;
t.ascend = (int) ascend; t.ascend = (int) ascend;
t.plainAscend = (int) ((ele_start - ele_end) * eleFactor + 0.5); t.plainAscend = (int) ((ele_start - ele_end) * eleFactor + 0.5);