mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 07:28:45 +00:00
cope with zero lat long
This commit is contained in:
@@ -148,12 +148,15 @@ def extract_gps(dict):
|
||||
def extract(gpsifd):
|
||||
if item:=is_present(gpsifd): # walrus
|
||||
n, d = item
|
||||
return n/d
|
||||
if d:
|
||||
return n/d
|
||||
return None
|
||||
|
||||
def rational(tup):
|
||||
nom, denom = tup
|
||||
return nom/denom
|
||||
if denom:
|
||||
return nom/denom
|
||||
return None
|
||||
|
||||
def rationalise(item):
|
||||
df, mf, sf = item
|
||||
@@ -195,7 +198,10 @@ def extract_gps(dict):
|
||||
|
||||
if item := is_present("GPSTimeStamp"):
|
||||
h, m, s = rationalise(item)
|
||||
timestamp_utc = f"{ds} {h:02.0f}:{m:02.0f}:{s:02.0f} +00:00 UTC"
|
||||
if h and m and s:
|
||||
timestamp_utc = f"{ds} {h:02.0f}:{m:02.0f}:{s:02.0f} +00:00 UTC"
|
||||
else:
|
||||
timestamp_utc = f"{ds}"
|
||||
else:
|
||||
timestamp_utc = f"{ds}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user