Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevation raster generation (*.bef files) #644

Merged
merged 15 commits into from
Apr 3, 2024
21 changes: 19 additions & 2 deletions brouter-core/src/main/java/btools/router/RoutingEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import btools.mapaccess.OsmLinkHolder;
import btools.mapaccess.OsmNode;
import btools.mapaccess.OsmNodePairSet;
import btools.mapaccess.OsmPos;
import btools.util.CompactLongMap;
import btools.util.SortedHeap;
import btools.util.StackSampler;
Expand Down Expand Up @@ -855,11 +856,12 @@ private void recalcTrack(OsmTrack t) {
if (ele_last != Short.MIN_VALUE) {
ehb = ehb + (ele_last - ele) * eleFactor;
}
double filter = elevationFilter(n);
if (ehb > 0) {
ascend += ehb;
ehb = 0;
} else if (ehb < -10) {
ehb = -10;
} else if (ehb < filter) {
ehb = filter;
}
}

Expand Down Expand Up @@ -896,6 +898,21 @@ private void recalcTrack(OsmTrack t) {
logInfo("filtered ascend = " + t.ascend);
}

/**
* find the elevation type for position
* to determine the filter value
*
* @param n the point
* @return the filter value for 1sec / 3sec elevation source
*/
double elevationFilter(OsmPos n) {
if (nodesCache != null) {
int r = nodesCache.getElevationType(n.getILon(), n.getILat());
if (r == 1) return -5.;
}
return -10.;
}

// geometric position matching finding the nearest routable way-section
private void matchWaypointsToNodes(List<MatchedWaypoint> unmatchedWaypoints) {
resetCache(false);
Expand Down

This file was deleted.

Loading