Fix URLs for WOTA outlying fells

This commit is contained in:
Ian Renton
2025-11-14 14:37:36 +00:00
parent ae075f3ac7
commit 2a90b17b6b
2 changed files with 6 additions and 0 deletions

View File

@@ -98,7 +98,12 @@ def get_sig_ref_info(sig, sig_ref_id):
for feature in data["features"]: for feature in data["features"]:
if feature["properties"]["wotaId"] == sig_ref_id: if feature["properties"]["wotaId"] == sig_ref_id:
sig_ref.name = feature["properties"]["title"] sig_ref.name = feature["properties"]["title"]
# Fudge WOTA URLs. Outlying fell (LDO) URLs don't match their ID numbers but require 214 to be
# added to them
sig_ref.url = "https://www.wota.org.uk/MM_" + sig_ref_id sig_ref.url = "https://www.wota.org.uk/MM_" + sig_ref_id
if sig_ref_id.upper().startswith("LDO-"):
number = int(sig_ref_id.upper().replace("LDO-", ""))
sig_ref.url = "https://www.wota.org.uk/MM_LDO-" + str(number + 214)
sig_ref.grid = feature["properties"]["qthLocator"] sig_ref.grid = feature["properties"]["qthLocator"]
sig_ref.latitude = feature["geometry"]["coordinates"][1] sig_ref.latitude = feature["geometry"]["coordinates"][1]
sig_ref.longitude = feature["geometry"]["coordinates"][0] sig_ref.longitude = feature["geometry"]["coordinates"][0]

View File

@@ -10,6 +10,7 @@ from core.cleanup import CleanupTimer
from core.config import config, WEB_SERVER_PORT, SERVER_OWNER_CALLSIGN from core.config import config, WEB_SERVER_PORT, SERVER_OWNER_CALLSIGN
from core.constants import SOFTWARE_NAME, SOFTWARE_VERSION from core.constants import SOFTWARE_NAME, SOFTWARE_VERSION
from core.lookup_helper import lookup_helper from core.lookup_helper import lookup_helper
from core.sig_utils import get_sig_ref_info
from core.status_reporter import StatusReporter from core.status_reporter import StatusReporter
from server.webserver import WebServer from server.webserver import WebServer