From 5f493fdcabc5324ffdaf3ad6b3374b33d2420efc Mon Sep 17 00:00:00 2001 From: bert hubert Date: Thu, 5 Sep 2019 09:44:45 +0200 Subject: [PATCH] make us robust against missing TLE files --- tle.cc | 2 ++ tle.hh | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tle.cc b/tle.cc index 7dff8f3..b5d61ea 100644 --- a/tle.cc +++ b/tle.cc @@ -102,6 +102,8 @@ TLERepo::Match TLERepo::getBestMatch(time_t now, double x, double y, double z, T continue; } } + if(distances.empty()) + return TLERepo::Match(); if(secondbest) { auto iter = distances.begin(); if(iter != distances.end()) { diff --git a/tle.hh b/tle.hh index 572cdeb..83e8f5d 100644 --- a/tle.hh +++ b/tle.hh @@ -16,14 +16,14 @@ public: std::string name; int norad; std::string internat; - double inclination; // radians + double inclination{360}; // radians double ran; // radians - double e; - double ecefX; // m - double ecefY; // m - double ecefZ; // m + double e{-1}; + double ecefX{0}; // m + double ecefY{0}; // m + double ecefZ{0}; // m - double eciX, eciY, eciZ; // m + double eciX{0}, eciY{0}, eciZ{0}; // m double distance{-1}; // m double latitude, longitude, altitude;