Merge pull request #506 from quaelnix/eta-regression-fix
Fix regression in travel time computation
This commit is contained in:
commit
ca5279d7c7
1 changed files with 3 additions and 5 deletions
|
@ -177,13 +177,11 @@ final class StdPath extends OsmPath {
|
||||||
|
|
||||||
private double calcIncline(double dist) {
|
private double calcIncline(double dist) {
|
||||||
double min_delta = 3.;
|
double min_delta = 3.;
|
||||||
double shift;
|
double shift = 0.;
|
||||||
if (elevation_buffer > min_delta) {
|
if (elevation_buffer > min_delta) {
|
||||||
shift = -min_delta;
|
shift = -min_delta;
|
||||||
} else if (elevation_buffer < min_delta) {
|
} else if (elevation_buffer < -min_delta) {
|
||||||
shift = -min_delta;
|
shift = min_delta;
|
||||||
} else {
|
|
||||||
return 0.;
|
|
||||||
}
|
}
|
||||||
double decayFactor = FastMath.exp(-dist / 100.);
|
double decayFactor = FastMath.exp(-dist / 100.);
|
||||||
float new_elevation_buffer = (float) ((elevation_buffer + shift) * decayFactor - shift);
|
float new_elevation_buffer = (float) ((elevation_buffer + shift) * decayFactor - shift);
|
||||||
|
|
Loading…
Reference in a new issue