Merge pull request #506 from quaelnix/eta-regression-fix

Fix regression in travel time computation
This commit is contained in:
afischerdev 2023-02-13 18:47:14 +01:00 committed by GitHub
commit ca5279d7c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -177,13 +177,11 @@ final class StdPath extends OsmPath {
private double calcIncline(double dist) {
double min_delta = 3.;
double shift;
double shift = 0.;
if (elevation_buffer > min_delta) {
shift = -min_delta;
} else if (elevation_buffer < min_delta) {
shift = -min_delta;
} else {
return 0.;
} else if (elevation_buffer < -min_delta) {
shift = min_delta;
}
double decayFactor = FastMath.exp(-dist / 100.);
float new_elevation_buffer = (float) ((elevation_buffer + shift) * decayFactor - shift);