Skip to content

Commit

Permalink
Merge pull request abrensch#644 from afischerdev/srtm-gen
Browse files Browse the repository at this point in the history
Elevation raster generation (*.bef files)
  • Loading branch information
afischerdev authored Apr 3, 2024
2 parents 7b176b4 + dcc9719 commit 6330325
Show file tree
Hide file tree
Showing 17 changed files with 1,418 additions and 782 deletions.
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 @@ -907,11 +908,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 @@ -948,6 +950,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

0 comments on commit 6330325

Please sign in to comment.