Improvements to getting lat/lon from spots. Closes #123

This commit is contained in:
Ian Renton
2026-08-08 08:19:51 +01:00
parent 8d28a29f82
commit 985646bb94
15 changed files with 38 additions and 29 deletions
+8 -6
View File
@@ -34,6 +34,10 @@ class GMA(HTTPSpotProvider):
if "RCD" in http_response.json():
for source_spot in http_response.json()["RCD"]:
# Convert to our spot format
# Seen GMA spots with no (or empty) lat/lon
lat = float(source_spot["LAT"]) if (source_spot["LAT"] and source_spot["LAT"] != "") else None
lon = float(source_spot["LON"]) if (source_spot["LON"] and source_spot["LON"] != "") else None
spot = Spot(source=self.name,
dx_call=source_spot["ACTIVATOR"].upper(),
de_call=source_spot["SPOTTER"].upper(),
@@ -43,14 +47,12 @@ class GMA(HTTPSpotProvider):
# Filter out some weird mode strings
mode=source_spot["MODE"].upper() if "<>" not in source_spot["MODE"] else None,
comment=source_spot["TEXT"],
sig_refs=[SIGRef(id=source_spot["REF"], sig="", name=source_spot["NAME"])],
sig_refs=[SIGRef(id=source_spot["REF"], sig="", name=source_spot["NAME"], latitude=lat,
longitude=lon)],
time=datetime.strptime(source_spot["DATE"] + source_spot["TIME"], "%Y%m%d%H%M").replace(
tzinfo=pytz.UTC).timestamp(),
# Seen GMA spots with no (or empty) lat/lon
dx_latitude=float(source_spot["LAT"]) if (
source_spot["LAT"] and source_spot["LAT"] != "") else None,
dx_longitude=float(source_spot["LON"]) if (
source_spot["LON"] and source_spot["LON"] != "") else None,
dx_latitude=lat,
dx_longitude=lon,
qrt=source_spot["QRG"] == "QRT")
# GMA doesn't give what programme (SIG) the reference is for until we separately look it up.