summaryrefslogtreecommitdiff
path: root/gpsprof
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2017-05-28 13:51:31 -0700
committerFred Wright <fw@fwright.net>2017-07-18 14:32:22 -0700
commit795908afe3435d3095bb9ceb81c8b35fd1e22805 (patch)
tree9a9cde3323faacd08b0cac4db2a1da177912612f /gpsprof
parentbda3f970bd713cf553dcca47beb22682a49c7081 (diff)
downloadgpsd-795908afe3435d3095bb9ceb81c8b35fd1e22805.tar.gz
gpsprof: accept valid samples only.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Fred Wright <fw@fwright.net> TESTED: Verified that gpsprof still produces output. - fw
Diffstat (limited to 'gpsprof')
-rwxr-xr-xgpsprof8
1 files changed, 5 insertions, 3 deletions
diff --git a/gpsprof b/gpsprof
index 23a18c21..a4e58fd6 100755
--- a/gpsprof
+++ b/gpsprof
@@ -190,9 +190,11 @@ class spaceplot(plotter):
def sample(self):
# Watch out for the NaN value from gps.py.
- self.fixes.append((self.session.fix.latitude,
- self.session.fix.longitude,
- self.session.fix.altitude))
+ if (self.session.valid &
+ (gps.ONLINE_SET | gps.PACKET_SET | gps.LATLON_SET)):
+ self.fixes.append((self.session.fix.latitude,
+ self.session.fix.longitude,
+ self.session.fix.altitude))
return True
def header(self):