1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Properly handle files without elevation data

This commit is contained in:
Martin Tůma 2019-09-28 23:56:59 +02:00
parent 070eff2115
commit fa08c0dbea
3 changed files with 2 additions and 3 deletions

View File

@ -54,6 +54,7 @@ public:
return false; return false;
return true; return true;
} }
bool hasTime() const bool hasTime() const
{ {
for (int i = 0; i < size(); i++) { for (int i = 0; i < size(); i++) {

View File

@ -1,4 +1,3 @@
#include "dem.h"
#include "route.h" #include "route.h"

View File

@ -1,4 +1,3 @@
#include "dem.h"
#include "track.h" #include "track.h"
@ -177,7 +176,7 @@ Graph Track::elevation() const
GraphSegment gs; GraphSegment gs;
for (int j = 0; j < sd.size(); j++) { for (int j = 0; j < sd.size(); j++) {
if (seg.outliers.contains(j)) if (!sd.at(j).hasElevation() || seg.outliers.contains(j))
continue; continue;
gs.append(GraphPoint(seg.distance.at(j), seg.time.at(j), gs.append(GraphPoint(seg.distance.at(j), seg.time.at(j),
sd.at(j).elevation())); sd.at(j).elevation()));