diff --git a/spotproviders/gma.py b/spotproviders/gma.py index 8a7d2f0..95352ae 100644 --- a/spotproviders/gma.py +++ b/spotproviders/gma.py @@ -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. diff --git a/spotproviders/hema.py b/spotproviders/hema.py index 05dc4e7..38864b4 100644 --- a/spotproviders/hema.py +++ b/spotproviders/hema.py @@ -59,7 +59,8 @@ class HEMA(HTTPSpotProvider): mode=freq_mode_match.group(2).upper(), comment=spotter_comment_match.group(2), sig="HEMA", - sig_refs=[SIGRef(id=spot_items[3].upper(), sig="HEMA", name=spot_items[4])], + sig_refs=[SIGRef(id=spot_items[3].upper(), sig="HEMA", name=spot_items[4], + latitude=float(spot_items[7]), longitude=float(spot_items[8]))], time=datetime.strptime(spot_items[0], "%d/%m/%Y %H:%M").replace( tzinfo=pytz.UTC).timestamp(), dx_latitude=float(spot_items[7]), diff --git a/spotproviders/pota.py b/spotproviders/pota.py index 0d29440..2befc35 100644 --- a/spotproviders/pota.py +++ b/spotproviders/pota.py @@ -29,7 +29,8 @@ class POTA(HTTPSpotProvider): mode=source_spot["mode"].upper(), comment=source_spot["comments"], sig="POTA", - sig_refs=[SIGRef(id=source_spot["reference"], sig="POTA", name=source_spot["name"])], + sig_refs=[SIGRef(id=source_spot["reference"], sig="POTA", name=source_spot["name"], + latitude=source_spot["latitude"], longitude=source_spot["longitude"])], time=datetime.strptime(source_spot["spotTime"], "%Y-%m-%dT%H:%M:%S").replace( tzinfo=pytz.UTC).timestamp(), dx_grid=source_spot["grid6"], diff --git a/spotproviders/sota.py b/spotproviders/sota.py index ca7079d..54831db 100644 --- a/spotproviders/sota.py +++ b/spotproviders/sota.py @@ -19,8 +19,6 @@ class SOTA(HTTPSpotProvider): # The actual data lookup all happens after parsing and checking the epoch. EPOCH_URL = "https://api-db2.sota.org.uk/api/spots/epoch" SPOTS_URL = "https://api-db2.sota.org.uk/api/spots/60/all/all" - # SOTA spots don't contain lat/lon, we need a separate lookup for that - SUMMIT_URL_ROOT = "https://api-db2.sota.org.uk/api/summits/" def __init__(self, provider_config): super().__init__("SOTA", provider_config, self.EPOCH_URL, self.POLL_INTERVAL_SEC) @@ -51,8 +49,12 @@ class SOTA(HTTPSpotProvider): mode=source_spot["mode"].upper(), comment=source_spot["comments"], sig="SOTA", - sig_refs=[SIGRef(id=source_spot["summitCode"], sig="SOTA", name=source_spot["summitName"], + sig_refs=[SIGRef(id=source_spot["summitCode"], sig="SOTA", + name=source_spot["summitName"], latitude=source_spot["latitude"], + longitude=source_spot["longitude"], activation_score=source_spot["points"])], + dx_latitude=source_spot["latitude"], + dx_longitude=source_spot["longitude"], time=datetime.fromisoformat(source_spot["timeStamp"].replace("Z", "+00:00")).timestamp()) # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do diff --git a/spotproviders/tiles.py b/spotproviders/tiles.py index b22eddd..8143a91 100644 --- a/spotproviders/tiles.py +++ b/spotproviders/tiles.py @@ -31,7 +31,8 @@ class Tiles(HTTPSpotProvider): # Tiles spots can include POTA & SOTA references, but ignore those on the basis that we will get them separately from the POTA/SOTA providers anyway. # Just take the grid reference itself as the single Tiles SIG reference. sig_refs=[SIGRef(id=source_spot["maidenhead_grid"], sig="Tiles", - name=source_spot["maidenhead_grid"])], + name=source_spot["maidenhead_grid"], latitude=source_spot["latitude"], + longitude=source_spot["longitude"])], time=datetime.fromisoformat(source_spot["created_at"].replace("Z", "+00:00")).timestamp(), dx_grid=source_spot["maidenhead_grid"], dx_latitude=source_spot["latitude"], diff --git a/spotproviders/wwbota.py b/spotproviders/wwbota.py index 53204b3..3996cf3 100644 --- a/spotproviders/wwbota.py +++ b/spotproviders/wwbota.py @@ -20,7 +20,8 @@ class WWBOTA(SSESpotProvider): # n-fer activations. refs = [] for ref in source_spot["references"]: - sigref = SIGRef(id=ref["reference"], sig="WWBOTA", name=ref["name"]) + sigref = SIGRef(id=ref["reference"], sig="WWBOTA", name=ref["name"], latitude=ref["lat"], + longitude=ref["long"]) refs.append(sigref) spot = Spot(source=self.name, diff --git a/spotproviders/wwff.py b/spotproviders/wwff.py index 8e3642e..2620b23 100644 --- a/spotproviders/wwff.py +++ b/spotproviders/wwff.py @@ -29,7 +29,8 @@ class WWFF(HTTPSpotProvider): mode=source_spot["mode"].upper(), comment=source_spot["remarks"], sig="WWFF", - sig_refs=[SIGRef(id=source_spot["reference"], sig="WWFF", name=source_spot["reference_name"])], + sig_refs=[SIGRef(id=source_spot["reference"], sig="WWFF", name=source_spot["reference_name"], + latitude=source_spot["latitude"], longitude=source_spot["longitude"])], time=datetime.fromtimestamp(source_spot["spot_time"], tz=pytz.UTC).timestamp(), dx_latitude=source_spot["latitude"], dx_longitude=source_spot["longitude"]) diff --git a/templates/add_spot.html b/templates/add_spot.html index 0f8a77a..ea5f42e 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index 9e9be25..a4fee4b 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index dc80446..49caa9d 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -75,8 +75,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 5c91645..ac1cdb9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 1e96dd0..77a587c 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 0ccc578..0a0fc84 100644 --- a/templates/map.html +++ b/templates/map.html @@ -108,8 +108,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index 8ad316d..87d84a8 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index e157184..687674e 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - +