Browse Source

Fix bug in height filter pointed out by Valerio Messina. height corrections should not be applied if the altitude is unknown.

tags/gpsbabel_1_5_4
tsteven4 3 years ago
parent
commit
1f5c461064
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      height.cc

+ 8
- 6
height.cc View File

@@ -109,12 +109,14 @@ correct_height(const Waypoint* wpt)
{
Waypoint* waypointp = (Waypoint*) wpt;

if (addopt) {
waypointp->altitude += addf;
}

if (wgs84tomslopt) {
waypointp->altitude -= wgs84_separation(waypointp->latitude, waypointp->longitude);
if (waypointp->altitude != unknown_alt) {
if (addopt) {
waypointp->altitude += addf;
}
if (wgs84tomslopt) {
waypointp->altitude -= wgs84_separation(waypointp->latitude, waypointp->longitude);
}
}
}



Loading…
Cancel
Save