Skip to content

Commit 6330325

Browse files
authored
Merge pull request #644 from afischerdev/srtm-gen
Elevation raster generation (*.bef files)
2 parents 7b176b4 + dcc9719 commit 6330325

File tree

17 files changed

+1418
-782
lines changed

17 files changed

+1418
-782
lines changed

brouter-core/src/main/java/btools/router/RoutingEngine.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import btools.mapaccess.OsmLinkHolder;
2121
import btools.mapaccess.OsmNode;
2222
import btools.mapaccess.OsmNodePairSet;
23+
import btools.mapaccess.OsmPos;
2324
import btools.util.CompactLongMap;
2425
import btools.util.SortedHeap;
2526
import btools.util.StackSampler;
@@ -907,11 +908,12 @@ private void recalcTrack(OsmTrack t) {
907908
if (ele_last != Short.MIN_VALUE) {
908909
ehb = ehb + (ele_last - ele) * eleFactor;
909910
}
911+
double filter = elevationFilter(n);
910912
if (ehb > 0) {
911913
ascend += ehb;
912914
ehb = 0;
913-
} else if (ehb < -10) {
914-
ehb = -10;
915+
} else if (ehb < filter) {
916+
ehb = filter;
915917
}
916918
}
917919

@@ -948,6 +950,21 @@ private void recalcTrack(OsmTrack t) {
948950
logInfo("filtered ascend = " + t.ascend);
949951
}
950952

953+
/**
954+
* find the elevation type for position
955+
* to determine the filter value
956+
*
957+
* @param n the point
958+
* @return the filter value for 1sec / 3sec elevation source
959+
*/
960+
double elevationFilter(OsmPos n) {
961+
if (nodesCache != null) {
962+
int r = nodesCache.getElevationType(n.getILon(), n.getILat());
963+
if (r == 1) return -5.;
964+
}
965+
return -10.;
966+
}
967+
951968
// geometric position matching finding the nearest routable way-section
952969
private void matchWaypointsToNodes(List<MatchedWaypoint> unmatchedWaypoints) {
953970
resetCache(false);

brouter-map-creator/src/main/java/btools/mapcreator/ConvertLidarTile.java

Lines changed: 0 additions & 250 deletions
This file was deleted.

0 commit comments

Comments
 (0)