From 605b172bb3cc08cb1735452e0565aacc27f7bd01 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sat, 8 Aug 2026 13:19:28 +0100 Subject: [PATCH] Replace "WAB/WAI GRID" as a location source. Closes #116 --- data/spot.py | 18 +++++++++--------- providers/spot/tiles.py | 3 ++- static/apidocs/openapi.yml | 15 ++++++++++++--- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/data/spot.py b/data/spot.py index 9b12452..f9730a6 100644 --- a/data/spot.py +++ b/data/spot.py @@ -57,12 +57,12 @@ class Spot: # lookup dx_latitude: float | None = None dx_longitude: float | None = None - # DX Location source. Indicates how accurate the location might be. Values: "SPOT", "WAB/WAI GRID", "HOME QTH", - # "DXCC", "NONE" + # DX Location source. Indicates how accurate the location might be. Values: "SPOT", "GRID", "SIG REF LOOKUP", + # "HOME QTH", "DXCC", "NONE" dx_location_source: str = "NONE" # DX Location good. Indicates that the software thinks the location data is good enough to plot on a map. This is - # true if the location source is "SPOT" or "WAB/WAI GRID", or if the location source is "HOME QTH" and the DX - # callsign doesn't have a suffix like /P. + # true if the location source is "SPOT", "SIG REF LOOKUP" or "GRID", or if the location source is "HOME QTH" and the + # DX callsign doesn't have a suffix like /P. dx_location_good: bool = False # DE (Spotter) info @@ -296,8 +296,8 @@ class Spot: if sig_ref.latitude and not self.dx_latitude: self.dx_latitude = sig_ref.latitude self.dx_longitude = sig_ref.longitude - if self.sig == "WAB" or self.sig == "WAI": - self.dx_location_source = "WAB/WAI GRID" + if self.sig == "WAB" or self.sig == "WAI" or self.sig == "Tiles": + self.dx_location_source = "GRID" else: self.dx_location_source = "SIG REF LOOKUP" @@ -319,7 +319,7 @@ class Spot: self.de_grid = grid_mode_grid_match.group(1).upper() if not self.dx_grid: self.dx_grid = grid_mode_grid_match.group(4).upper() - self.dx_location_source = "SPOT" + self.dx_location_source = "GRID" # And extract propagation mode (group 2 for <...>, group 3 for (...)): mode_tag = (grid_mode_grid_match.group(2) or grid_mode_grid_match.group(3) or "").upper() @@ -339,7 +339,7 @@ class Spot: # regex matches, so extract grids: if not self.dx_grid: self.dx_grid = grid_mode_grid_match.group(1).upper() - self.dx_location_source = "SPOT" + self.dx_location_source = "GRID" if not self.de_grid: self.de_grid = grid_mode_grid_match.group(2).upper() @@ -411,7 +411,7 @@ class Spot: # is likely at home. self.dx_location_good = bool(self.dx_latitude and self.dx_longitude and ( self.dx_location_source == "SPOT" or self.dx_location_source == "SIG REF LOOKUP" - or self.dx_location_source == "WAB/WAI GRID" + or self.dx_location_source == "GRID" or (self.dx_location_source == "HOME QTH" and "/" not in (self.dx_call or "")))) # DE with no digits and APRS servers starting "T2" are not things we can look up location for diff --git a/providers/spot/tiles.py b/providers/spot/tiles.py index 674d52f..15eeb5d 100644 --- a/providers/spot/tiles.py +++ b/providers/spot/tiles.py @@ -42,7 +42,8 @@ class Tiles(HTTPSpotProvider): time=datetime.fromisoformat(source_spot["created_at"].replace("Z", "+00:00")).timestamp(), dx_grid=source_spot["maidenhead_grid"], dx_latitude=source_spot["latitude"], - dx_longitude=source_spot["longitude"]) + dx_longitude=source_spot["longitude"], + dx_location_source="GRID") # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do # that for us. diff --git a/static/apidocs/openapi.yml b/static/apidocs/openapi.yml index e9a6896..5d6378c 100644 --- a/static/apidocs/openapi.yml +++ b/static/apidocs/openapi.yml @@ -21,6 +21,7 @@ info: * **Breaking change:** Removed `cleanup` from `/status` response * **Breaking change:** in the `/options` response, renamed `spot_sources` and `alert_sources` to `spot_providers` and `alert_providers` * **Breaking change:** A user's QRZ.com and HamQTH credentials are now supplied as request headers (`X-QRZ-Username`, `X-QRZ-Password`, `X-QRZ-Session-Key`, `X-HamQTH-Username`, `X-HamQTH-Password`, `X-HamQTH-Session-ID`) rather than query parameters, to keep credentials out of server logs. + * **Breaking change:** "WAB/WAI GRID" as a location source has been renamed to just "GRID", and also applies to Tiles on the Air spots and grid references from cluster spot comments. * POST `/spot` now supports Google reCaptcha and (if the site owner has set it up) now requires `captcha_token` in order to successfully submit. (This is used to lock down the submit function and prevent submission via Spothole by bots or third-party clients.) * GET `/options` now returns `spot_submit_providers`, a map of SIG names to the names of providers that support upstream spot submission for that SIG. (This allows clients to present the user with options of where a new spot can be sent to.) * Added `sig_ref_data_providers`, `static_data_providers` and `callsign_data_providers` to `/status` response @@ -947,7 +948,7 @@ components: enum: - SPOT - "SIG REF LOOKUP" - - "WAB/WAI GRID" + - "GRID" - "HOME QTH" - DXCC - NONE @@ -1075,13 +1076,21 @@ components: Where we got the DX location (grid/latitude/longitude) from. If this was from the spot itself, or from a lookup of the SIG ref (e.g. park) it's likely quite accurate, but if we had to fall back to QRZ lookup, or even a location based on the DXCC itself, it will - be a lot less accurate. + be a lot less accurate. "SPOT" indicates the location source was the spot itself from the + spotting service. "SIG REF LOOKUP" indicates that the spot didn't provide a location, + but we looked it up from reference data. "GRID" indicates that the spot provided some + location data such as a Maidenhead, UK Ordnance Survey or Irish grid reference, but the + location is likely less accurate than "SPOT". "HOME QTH" indicates we looked up the DX + operator's given location from their QRZ.com or HamQTH profile, which might be + accurate unless they have a callsign prefix or suffic. "DXCC" indicates we have + nothing to go on but the country their callsign says they're from. Finally, "NONE" + indicates there is no location data at all. $ref: "#/components/schemas/LocationSourceForSpot" dx_location_good: type: boolean description: > Does the software think the location is good enough to put a marker on a map? This is - true if the source is "SPOT", "SIG REF LOOKUP" or "WAB/WAI GRID", or alternatively if + true if the source is "SPOT", "SIG REF LOOKUP" or "GRID", or alternatively if the source is "HOME QTH" and the callsign doesn't have a slash in it (i.e. operator likely at home). example: true