Replace "WAB/WAI GRID" as a location source. Closes #116

This commit is contained in:
Ian Renton
2026-08-08 13:19:28 +01:00
parent 1651629109
commit 605b172bb3
3 changed files with 23 additions and 13 deletions
+9 -9
View File
@@ -57,12 +57,12 @@ class Spot:
# lookup # lookup
dx_latitude: float | None = None dx_latitude: float | None = None
dx_longitude: 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", # DX Location source. Indicates how accurate the location might be. Values: "SPOT", "GRID", "SIG REF LOOKUP",
# "DXCC", "NONE" # "HOME QTH", "DXCC", "NONE"
dx_location_source: str = "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 # 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 # true if the location source is "SPOT", "SIG REF LOOKUP" or "GRID", or if the location source is "HOME QTH" and the
# callsign doesn't have a suffix like /P. # DX callsign doesn't have a suffix like /P.
dx_location_good: bool = False dx_location_good: bool = False
# DE (Spotter) info # DE (Spotter) info
@@ -296,8 +296,8 @@ class Spot:
if sig_ref.latitude and not self.dx_latitude: if sig_ref.latitude and not self.dx_latitude:
self.dx_latitude = sig_ref.latitude self.dx_latitude = sig_ref.latitude
self.dx_longitude = sig_ref.longitude self.dx_longitude = sig_ref.longitude
if self.sig == "WAB" or self.sig == "WAI": if self.sig == "WAB" or self.sig == "WAI" or self.sig == "Tiles":
self.dx_location_source = "WAB/WAI GRID" self.dx_location_source = "GRID"
else: else:
self.dx_location_source = "SIG REF LOOKUP" self.dx_location_source = "SIG REF LOOKUP"
@@ -319,7 +319,7 @@ class Spot:
self.de_grid = grid_mode_grid_match.group(1).upper() self.de_grid = grid_mode_grid_match.group(1).upper()
if not self.dx_grid: if not self.dx_grid:
self.dx_grid = grid_mode_grid_match.group(4).upper() 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 (...)): # 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() 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: # regex matches, so extract grids:
if not self.dx_grid: if not self.dx_grid:
self.dx_grid = grid_mode_grid_match.group(1).upper() 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: if not self.de_grid:
self.de_grid = grid_mode_grid_match.group(2).upper() self.de_grid = grid_mode_grid_match.group(2).upper()
@@ -411,7 +411,7 @@ class Spot:
# is likely at home. # is likely at home.
self.dx_location_good = bool(self.dx_latitude and self.dx_longitude and ( 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" 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 "")))) 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 # DE with no digits and APRS servers starting "T2" are not things we can look up location for
+2 -1
View File
@@ -42,7 +42,8 @@ class Tiles(HTTPSpotProvider):
time=datetime.fromisoformat(source_spot["created_at"].replace("Z", "+00:00")).timestamp(), time=datetime.fromisoformat(source_spot["created_at"].replace("Z", "+00:00")).timestamp(),
dx_grid=source_spot["maidenhead_grid"], dx_grid=source_spot["maidenhead_grid"],
dx_latitude=source_spot["latitude"], 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 # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do
# that for us. # that for us.
+12 -3
View File
@@ -21,6 +21,7 @@ info:
* **Breaking change:** Removed `cleanup` from `/status` response * **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:** 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:** 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.) * 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.) * 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 * Added `sig_ref_data_providers`, `static_data_providers` and `callsign_data_providers` to `/status` response
@@ -947,7 +948,7 @@ components:
enum: enum:
- SPOT - SPOT
- "SIG REF LOOKUP" - "SIG REF LOOKUP"
- "WAB/WAI GRID" - "GRID"
- "HOME QTH" - "HOME QTH"
- DXCC - DXCC
- NONE - NONE
@@ -1075,13 +1076,21 @@ components:
Where we got the DX location (grid/latitude/longitude) from. If this was from the spot 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 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 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" $ref: "#/components/schemas/LocationSourceForSpot"
dx_location_good: dx_location_good:
type: boolean type: boolean
description: > description: >
Does the software think the location is good enough to put a marker on a map? This is 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 the source is "HOME QTH" and the callsign doesn't have a slash in it (i.e. operator
likely at home). likely at home).
example: true example: true