From fc4ee50a88fbb98d57a13e1daa21d7a4785297f5 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 14 Jun 2012 18:14:53 -0700 Subject: [PATCH] Fix KML for new GE which is more space-sensitive than old GE --- python/cpr.py | 6 ++++-- python/modes_kml.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/cpr.py b/python/cpr.py index 108104e..270477a 100644 --- a/python/cpr.py +++ b/python/cpr.py @@ -56,6 +56,8 @@ def nl_eo(declat_in, ctype): return nl(declat_in) - ctype def nl(declat_in): + if declat_in == 0: + declat_in = 0.01 return math.floor( (2.0*math.pi) * pow(math.acos(1.0- (1.0-math.cos(math.pi/(2.0*latz))) / pow( math.cos( (math.pi/180.0)*abs(declat_in) ) ,2.0) ),-1.0)) def dlon(declat_in, ctype, surface): @@ -102,8 +104,8 @@ def cpr_resolve_local(my_location, encoded_location, ctype, surface): return [decoded_lat, decoded_lon] def cpr_resolve_global(evenpos, oddpos, mostrecent, surface): #ok this is considered working, tentatively - dlateven = dlat(0, surface); - dlatodd = dlat(1, surface); + dlateven = dlat(0, surface) + dlatodd = dlat(1, surface) evenpos = [float(evenpos[0]), float(evenpos[1])] oddpos = [float(oddpos[0]), float(oddpos[1])] diff --git a/python/modes_kml.py b/python/modes_kml.py index 6ea9393..046ee42 100644 --- a/python/modes_kml.py +++ b/python/modes_kml.py @@ -116,7 +116,7 @@ class modes_kml(threading.Thread, modes_output_sql): trackstr = "" for pos in track: - trackstr += " %f, %f, %f" % (pos[4], pos[3], pos[2]*0.3048) + trackstr += " %f,%f,%f" % (pos[4], pos[3], pos[2]*0.3048) trackstr = string.lstrip(trackstr) else: