mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-14 16:37:33 +00:00
Add types and altitudes to SIG Ref lookups
This commit is contained in:
@@ -29,6 +29,7 @@ def get_sig_ref_info(sig, ref_id):
|
|||||||
|
|
||||||
# If the SIG is HEMA, we have no current lookup for this so just skip the lookup here.
|
# If the SIG is HEMA, we have no current lookup for this so just skip the lookup here.
|
||||||
if sig.upper() == "HEMA":
|
if sig.upper() == "HEMA":
|
||||||
|
sig_ref.type = "Summit"
|
||||||
return sig_ref
|
return sig_ref
|
||||||
|
|
||||||
### PROGRAMMATIC DATA GENERATION INSTEAD OF LOOKUPS ###
|
### PROGRAMMATIC DATA GENERATION INSTEAD OF LOOKUPS ###
|
||||||
@@ -37,6 +38,7 @@ def get_sig_ref_info(sig, ref_id):
|
|||||||
# calculate all the information we are going to get directly.
|
# calculate all the information we are going to get directly.
|
||||||
if sig.upper() == "TILES":
|
if sig.upper() == "TILES":
|
||||||
# Tiles on the Air just uses Maidenhead 6-digit squares, so ID, Name and Grid are all the same
|
# Tiles on the Air just uses Maidenhead 6-digit squares, so ID, Name and Grid are all the same
|
||||||
|
sig_ref.type = "Grid"
|
||||||
if not sig_ref.name:
|
if not sig_ref.name:
|
||||||
sig_ref.name = sig_ref.id
|
sig_ref.name = sig_ref.id
|
||||||
if not sig_ref.grid:
|
if not sig_ref.grid:
|
||||||
@@ -48,6 +50,7 @@ def get_sig_ref_info(sig, ref_id):
|
|||||||
return sig_ref
|
return sig_ref
|
||||||
|
|
||||||
elif sig.upper() == "WAB" or sig.upper() == "WAI":
|
elif sig.upper() == "WAB" or sig.upper() == "WAI":
|
||||||
|
sig_ref.type = "Grid"
|
||||||
ll = wab_wai_square_to_lat_lon(ref_id)
|
ll = wab_wai_square_to_lat_lon(ref_id)
|
||||||
if ll:
|
if ll:
|
||||||
sig_ref.name = ref_id
|
sig_ref.name = ref_id
|
||||||
@@ -61,6 +64,7 @@ def get_sig_ref_info(sig, ref_id):
|
|||||||
|
|
||||||
elif sig.upper() == "BOTA":
|
elif sig.upper() == "BOTA":
|
||||||
# For BOTA all we can ever generate is the URL, there is no data file or lookup for lat/longs
|
# For BOTA all we can ever generate is the URL, there is no data file or lookup for lat/longs
|
||||||
|
sig_ref.type = "Beach"
|
||||||
if not sig_ref.name:
|
if not sig_ref.name:
|
||||||
sig_ref.name = sig_ref.id
|
sig_ref.name = sig_ref.id
|
||||||
sig_ref.url = "https://www.beachesontheair.com/beaches/" + sig_ref.name.lower().replace(" ", "-")
|
sig_ref.url = "https://www.beachesontheair.com/beaches/" + sig_ref.name.lower().replace(" ", "-")
|
||||||
|
|||||||
+7
-3
@@ -12,13 +12,17 @@ class SIGRef:
|
|||||||
sig: str
|
sig: str
|
||||||
# Name of the reference, e.g. "Null Country Park", if known.
|
# Name of the reference, e.g. "Null Country Park", if known.
|
||||||
name: str | None = None
|
name: str | None = None
|
||||||
|
# Type of the reference, e.g. "Park", if known.
|
||||||
|
type: str | None = None
|
||||||
# URL to look up more information about the reference, if known.
|
# URL to look up more information about the reference, if known.
|
||||||
url: str | None = None
|
url: str | None = None
|
||||||
# Latitude of the reference, if known.
|
# Latitude of the reference, in degrees, if known.
|
||||||
latitude: float | None = None
|
latitude: float | None = None
|
||||||
# Longitude of the reference, if known.
|
# Longitude of the reference, in degrees, if known.
|
||||||
longitude: float | None = None
|
longitude: float | None = None
|
||||||
# Maidenhead grid reference of the reference, if known.
|
# Altitude of the reference, in metres, if known.
|
||||||
|
altitude: float | None = None
|
||||||
|
# Maidenhead grid ref of the reference, if known.
|
||||||
grid: str | None = None
|
grid: str | None = None
|
||||||
# Activation score. SOTA only
|
# Activation score. SOTA only
|
||||||
activation_score: int | None = None
|
activation_score: int | None = None
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class ARLHS(FileDownloadSIGRefDataProvider):
|
|||||||
if "ARLHS" in row and row["ARLHS"] != "":
|
if "ARLHS" in row and row["ARLHS"] != "":
|
||||||
ref_id = row["ARLHS"]
|
ref_id = row["ARLHS"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
||||||
|
type="Lighthouse",
|
||||||
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
||||||
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
||||||
"Latitude"] != "" else None,
|
"Latitude"] != "" else None,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class DME(LocalFileSIGRefDataProvider):
|
|||||||
"LONGITUD_ETRS89_REGCAN95") else None
|
"LONGITUD_ETRS89_REGCAN95") else None
|
||||||
|
|
||||||
ref = SIGRef(sig=self.SIG, id=ref_id,
|
ref = SIGRef(sig=self.SIG, id=ref_id,
|
||||||
|
type="Town",
|
||||||
name=row["NOMBRE_ACTUAL"] + ", " + row["PROVINCIA"],
|
name=row["NOMBRE_ACTUAL"] + ", " + row["PROVINCIA"],
|
||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude)
|
longitude=longitude)
|
||||||
|
|||||||
@@ -20,11 +20,14 @@ class GMA(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()[1:]):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()[1:]):
|
||||||
ref_id = row["Reference"]
|
ref_id = row["Reference"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
||||||
|
type="Summit",
|
||||||
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
||||||
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
||||||
"Latitude"] != "" else None,
|
"Latitude"] != "" else None,
|
||||||
longitude=float(row["Longitude"]) if "Longitude" in row and row[
|
longitude=float(row["Longitude"]) if "Longitude" in row and row[
|
||||||
"Longitude"] != "" else None,
|
"Longitude"] != "" else None,
|
||||||
|
altitude=float(row["Height (m)"].replace("m", "")) if "Height (m)" in row and row[
|
||||||
|
"Height (m)"] != "" else None,
|
||||||
grid=row["Maidenhead Locator"]))
|
grid=row["Maidenhead Locator"]))
|
||||||
|
|
||||||
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
|
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ class ILLW(FileDownloadSIGRefDataProvider):
|
|||||||
if "ILLW" in row and row["ILLW"] != "":
|
if "ILLW" in row and row["ILLW"] != "":
|
||||||
ref_id = row["ILLW"]
|
ref_id = row["ILLW"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
||||||
|
type="Lighthouse",
|
||||||
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
||||||
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
||||||
"Latitude"] != "" else None,
|
"Latitude"] != "" else None,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class IOTA(FileDownloadSIGRefDataProvider):
|
|||||||
logging.debug(f"Error converting lat/lon to locator for an IOTA reference %f %f", latitude, longitude)
|
logging.debug(f"Error converting lat/lon to locator for an IOTA reference %f %f", latitude, longitude)
|
||||||
|
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
||||||
grid=grid, latitude=latitude, longitude=longitude))
|
type="Island", grid=grid, latitude=latitude, longitude=longitude))
|
||||||
|
|
||||||
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
||||||
# of the data in this case
|
# of the data in this case
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class LLOTA(FileDownloadSIGRefDataProvider):
|
|||||||
ll = locator_to_latlong(grid)
|
ll = locator_to_latlong(grid)
|
||||||
|
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=str(ref["name"]),
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=str(ref["name"]),
|
||||||
|
type="Lake",
|
||||||
url="https://llota.app/list/ref/" + ref_id,
|
url="https://llota.app/list/ref/" + ref_id,
|
||||||
grid=grid,
|
grid=grid,
|
||||||
latitude=ll[0],
|
latitude=ll[0],
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class MOTA(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()[1:]):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()[1:]):
|
||||||
ref_id = row["Reference"]
|
ref_id = row["Reference"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
||||||
|
type="Mill",
|
||||||
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
||||||
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
latitude=float(row["Latitude"]) if "Latitude" in row and row[
|
||||||
"Latitude"] != "" else None,
|
"Latitude"] != "" else None,
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class ParksNPeaksKMLSIGRefDataProvider(FileDownloadSIGRefDataProvider):
|
|||||||
longitude, latitude = placemark.geometry.x, placemark.geometry.y
|
longitude, latitude = placemark.geometry.x, placemark.geometry.y
|
||||||
|
|
||||||
ref = SIGRef(sig=self.sig_name, id=ref_id, name=placemark.name,
|
ref = SIGRef(sig=self.sig_name, id=ref_id, name=placemark.name,
|
||||||
|
type="Park",
|
||||||
url="https://parksnpeaks.org/getPark.php?actPark=" + ref_id,
|
url="https://parksnpeaks.org/getPark.php?actPark=" + ref_id,
|
||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude)
|
longitude=longitude)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class POTA(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
||||||
ref_id = row["reference"]
|
ref_id = row["reference"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["name"] if "name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["name"] if "name" in row else None,
|
||||||
|
type="Park",
|
||||||
url="https://pota.app/#/park/" + ref_id,
|
url="https://pota.app/#/park/" + ref_id,
|
||||||
grid=row["grid"] if "grid" in row else None,
|
grid=row["grid"] if "grid" in row else None,
|
||||||
latitude=float(row["latitude"]) if "latitude" in row and row[
|
latitude=float(row["latitude"]) if "latitude" in row and row[
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class SIOTA(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
||||||
ref_id = row["SILO_CODE"]
|
ref_id = row["SILO_CODE"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["NAME"] if "NAME" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["NAME"] if "NAME" in row else None,
|
||||||
|
type="Silo",
|
||||||
grid=row["LOCATOR"] if "LOCATOR" in row else None,
|
grid=row["LOCATOR"] if "LOCATOR" in row else None,
|
||||||
latitude=float(row["LAT"]) if "LAT" in row else None,
|
latitude=float(row["LAT"]) if "LAT" in row else None,
|
||||||
longitude=float(row["LNG"]) if "LNG" in row else None))
|
longitude=float(row["LNG"]) if "LNG" in row else None))
|
||||||
|
|||||||
@@ -23,10 +23,13 @@ class SOTA(FileDownloadSIGRefDataProvider):
|
|||||||
ref_id = row["SummitCode"]
|
ref_id = row["SummitCode"]
|
||||||
latitude = float(row["Latitude"]) if "Latitude" in row and row["Latitude"] != "" else None
|
latitude = float(row["Latitude"]) if "Latitude" in row and row["Latitude"] != "" else None
|
||||||
longitude = float(row["Longitude"]) if "Longitude" in row and row["Longitude"] != "" else None
|
longitude = float(row["Longitude"]) if "Longitude" in row and row["Longitude"] != "" else None
|
||||||
|
altitude = float(row["AltM"]) if "AltM" in row and row["AltM"] != "" else None
|
||||||
ref = SIGRef(sig=self.SIG, id=ref_id, name=row["SummitName"] if "SummitName" in row else None,
|
ref = SIGRef(sig=self.SIG, id=ref_id, name=row["SummitName"] if "SummitName" in row else None,
|
||||||
|
type="Summit",
|
||||||
url="https://www.sotadata.org.uk/en/summit/" + ref_id,
|
url="https://www.sotadata.org.uk/en/summit/" + ref_id,
|
||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude,
|
longitude=longitude,
|
||||||
|
altitude=altitude,
|
||||||
activation_score=int(row["Points"]) if "Points" in row else None)
|
activation_score=int(row["Points"]) if "Points" in row else None)
|
||||||
if latitude and longitude:
|
if latitude and longitude:
|
||||||
ref.grid = latlong_to_locator(latitude, longitude, 6)
|
ref.grid = latlong_to_locator(latitude, longitude, 6)
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ class Toilets(LocalFileSIGRefDataProvider):
|
|||||||
csv_data = _f.read()
|
csv_data = _f.read()
|
||||||
dr = csv.DictReader(csv_data.splitlines())
|
dr = csv.DictReader(csv_data.splitlines())
|
||||||
for row in dr:
|
for row in dr:
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=row["ref"], name=row["ref"], latitude=float(row["lat"]),
|
new_data.append(SIGRef(sig=self.SIG, id=row["ref"], name=row["ref"], type="Toilet",
|
||||||
longitude=float(row["lon"])))
|
latitude=float(row["lat"]), longitude=float(row["lon"])))
|
||||||
|
|
||||||
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
||||||
# of the data in this case
|
# of the data in this case
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class Towers(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines(), delimiter=";"):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines(), delimiter=";"):
|
||||||
ref_id = row["Ref"]
|
ref_id = row["Ref"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Nazev"] if "Nazev" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Nazev"] if "Nazev" in row else None,
|
||||||
|
type="Tower",
|
||||||
url="https://wwtota.com/seznam/karta_rozhledny.php?ref=" + ref_id,
|
url="https://wwtota.com/seznam/karta_rozhledny.php?ref=" + ref_id,
|
||||||
grid=row["Lokator"] if "Lokator" in row and row["Lokator"] != "" else None,
|
grid=row["Lokator"] if "Lokator" in row and row["Lokator"] != "" else None,
|
||||||
latitude=float(row["Lat"]) if "Lat" in row and row["Lat"] != "" else None,
|
latitude=float(row["Lat"]) if "Lat" in row and row["Lat"] != "" else None,
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class WCA(FileDownloadSIGRefDataProvider):
|
|||||||
logging.debug(f"Encountered dodgy formatting in WCA CSV, skipping location data for %s", ref_id)
|
logging.debug(f"Encountered dodgy formatting in WCA CSV, skipping location data for %s", ref_id)
|
||||||
|
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["CLEAN NAME"] if "CLEAN NAME" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["CLEAN NAME"] if "CLEAN NAME" in row else None,
|
||||||
|
type="Castle",
|
||||||
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
url="https://www.cqgma.org/zinfo.php?ref=" + ref_id,
|
||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude,
|
longitude=longitude,
|
||||||
|
|||||||
@@ -26,9 +26,11 @@ class WOTA(FileDownloadSIGRefDataProvider):
|
|||||||
url = "https://www.wota.org.uk/MM_LDO-" + str(number + 214)
|
url = "https://www.wota.org.uk/MM_LDO-" + str(number + 214)
|
||||||
|
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=feature["properties"]["title"], url=url,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=feature["properties"]["title"], url=url,
|
||||||
|
type="Summit",
|
||||||
grid=feature["properties"]["qthLocator"],
|
grid=feature["properties"]["qthLocator"],
|
||||||
latitude=feature["geometry"]["coordinates"][1],
|
latitude=feature["geometry"]["coordinates"][1],
|
||||||
longitude=feature["geometry"]["coordinates"][0]))
|
longitude=feature["geometry"]["coordinates"][0],
|
||||||
|
altitude=feature["properties"]["height"]))
|
||||||
|
|
||||||
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
|
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
|
||||||
# the data in this case
|
# the data in this case
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class WWBOTA(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
||||||
ref_id = row["Reference"]
|
ref_id = row["Reference"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["Name"] if "Name" in row else None,
|
||||||
|
type="Bunker",
|
||||||
url="https://bunkerwiki.org/?s=" + ref_id if ref_id.startswith("B/G") else None,
|
url="https://bunkerwiki.org/?s=" + ref_id if ref_id.startswith("B/G") else None,
|
||||||
grid=row["Locator"] if "Locator" in row and row["Locator"] != "" else None,
|
grid=row["Locator"] if "Locator" in row and row["Locator"] != "" else None,
|
||||||
latitude=float(row["Lat"]) if "Lat" in row and row["Lat"] != "" else None,
|
latitude=float(row["Lat"]) if "Lat" in row and row["Lat"] != "" else None,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class WWFF(FileDownloadSIGRefDataProvider):
|
|||||||
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
for row in csv.DictReader(http_response.content.decode("utf-8-sig").splitlines()):
|
||||||
ref_id = row["reference"]
|
ref_id = row["reference"]
|
||||||
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["name"] if "name" in row else None,
|
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=row["name"] if "name" in row else None,
|
||||||
|
type="Park",
|
||||||
url="https://wwff.co/directory/?showRef=" + ref_id,
|
url="https://wwff.co/directory/?showRef=" + ref_id,
|
||||||
grid=row["iaruLocator"] if "iaruLocator" in row and row[
|
grid=row["iaruLocator"] if "iaruLocator" in row and row[
|
||||||
"iaruLocator"] != "-" else None,
|
"iaruLocator"] != "-" else None,
|
||||||
|
|||||||
@@ -26,11 +26,20 @@ class ZLOTA(FileDownloadSIGRefDataProvider):
|
|||||||
longitude = ref["longitude"]
|
longitude = ref["longitude"]
|
||||||
|
|
||||||
new_ref = SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
new_ref = SIGRef(sig=self.SIG, id=ref_id, name=ref["name"],
|
||||||
|
type=ref["asset_type"].title,
|
||||||
url="https://ontheair.nz/assets/" + ref_id.replace("/", "_"),
|
url="https://ontheair.nz/assets/" + ref_id.replace("/", "_"),
|
||||||
latitude=latitude,
|
latitude=latitude,
|
||||||
longitude=longitude)
|
longitude=longitude)
|
||||||
|
|
||||||
|
# Check lat/lon validity and update grid accordingly
|
||||||
if latitude and longitude:
|
if latitude and longitude:
|
||||||
ref.new_ref = latlong_to_locator(latitude, longitude, 6)
|
try:
|
||||||
|
new_ref.grid = latlong_to_locator(latitude, longitude, 6)
|
||||||
|
except ValueError:
|
||||||
|
# Junk lat/lon, remove from the spot
|
||||||
|
new_ref.latitude = None
|
||||||
|
new_ref.longitude = None
|
||||||
|
|
||||||
new_data.append(new_ref)
|
new_data.append(new_ref)
|
||||||
|
|
||||||
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ info:
|
|||||||
* 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
|
||||||
* Added `callsign_data_providers` and `spot_providers_enabled_by_default` to `/options` response
|
* Added `callsign_data_providers` and `spot_providers_enabled_by_default` to `/options` response
|
||||||
|
* SIG Refs now have `type` and `altitude` parameters
|
||||||
|
|
||||||
#### Upgrading a client from v1 to v2 API endpoints
|
#### Upgrading a client from v1 to v2 API endpoints
|
||||||
|
|
||||||
@@ -996,6 +997,10 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
description: SIG reference name
|
description: SIG reference name
|
||||||
example: Null Country Park
|
example: Null Country Park
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
description: SIG reference type
|
||||||
|
example: Park
|
||||||
url:
|
url:
|
||||||
type: string
|
type: string
|
||||||
description: SIG reference URL, which the user can look up for more information
|
description: SIG reference URL, which the user can look up for more information
|
||||||
@@ -1012,6 +1017,10 @@ components:
|
|||||||
type: number
|
type: number
|
||||||
description: Longitude of the reference, in degrees, if known.
|
description: Longitude of the reference, in degrees, if known.
|
||||||
example: -1.2345
|
example: -1.2345
|
||||||
|
altitude:
|
||||||
|
type: number
|
||||||
|
description: Altitude of the reference, in metres, if known.
|
||||||
|
example: 1234.5
|
||||||
activation_score:
|
activation_score:
|
||||||
type: integer
|
type: integer
|
||||||
description: Activation score. SOTA only
|
description: Activation score. SOTA only
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/add-spot.js?v=1786714362"></script>
|
<script src="/static/js/add-spot.js?v=1786715868"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-add-spot").addClass("active");
|
$("#nav-link-add-spot").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/alerts.js?v=1786714362"></script>
|
<script src="/static/js/alerts.js?v=1786715868"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-alerts").addClass("active");
|
$("#nav-link-alerts").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -79,8 +79,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1786714362"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1786715868"></script>
|
||||||
<script src="/static/js/bands.js?v=1786714362"></script>
|
<script src="/static/js/bands.js?v=1786715868"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-bands").addClass("active");
|
$("#nav-link-bands").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{% extends "skeleton.html" %}
|
{% extends "skeleton.html" %}
|
||||||
{% block head_extra %}
|
{% block head_extra %}
|
||||||
<link rel="stylesheet" href="/static/css/style.css?v=1786714362" type="text/css">
|
<link rel="stylesheet" href="/static/css/style.css?v=1786715868" type="text/css">
|
||||||
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
||||||
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
||||||
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
||||||
@@ -10,10 +10,10 @@
|
|||||||
<script src="/static/vendor/js/bootstrap-5.3.8.bundle.min.js"></script>
|
<script src="/static/vendor/js/bootstrap-5.3.8.bundle.min.js"></script>
|
||||||
<script src="/static/vendor/js/tinycolor2-1.6.0.min.js"></script>
|
<script src="/static/vendor/js/tinycolor2-1.6.0.min.js"></script>
|
||||||
|
|
||||||
<script src="/static/js/utils.js?v=1786714362"></script>
|
<script src="/static/js/utils.js?v=1786715868"></script>
|
||||||
<script src="/static/js/ui-ham.js?v=1786714362"></script>
|
<script src="/static/js/ui-ham.js?v=1786715868"></script>
|
||||||
<script src="/static/js/geo.js?v=1786714362"></script>
|
<script src="/static/js/geo.js?v=1786715868"></script>
|
||||||
<script src="/static/js/common.js?v=1786714362"></script>
|
<script src="/static/js/common.js?v=1786715868"></script>
|
||||||
{% end %}
|
{% end %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
||||||
<script src="/static/js/conditions.js?v=1786714362"></script>
|
<script src="/static/js/conditions.js?v=1786715868"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-conditions").addClass("active");
|
$("#nav-link-conditions").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
+2
-2
@@ -112,8 +112,8 @@
|
|||||||
<script src="/static/vendor/js/leaflet-cqzones.js"></script>
|
<script src="/static/vendor/js/leaflet-cqzones.js"></script>
|
||||||
<script src="/static/vendor/js/leaflet-workedallbritainireland.js" type="module"></script>
|
<script src="/static/vendor/js/leaflet-workedallbritainireland.js" type="module"></script>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1786714362"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1786715868"></script>
|
||||||
<script src="/static/js/map.js?v=1786714362"></script>
|
<script src="/static/js/map.js?v=1786715868"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-map").addClass("active");
|
$("#nav-link-map").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -118,8 +118,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1786714362"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1786715868"></script>
|
||||||
<script src="/static/js/spots.js?v=1786714362"></script>
|
<script src="/static/js/spots.js?v=1786715868"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-spots").addClass("active");
|
$("#nav-link-spots").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/status.js?v=1786714362"></script>
|
<script src="/static/js/status.js?v=1786715868"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#nav-link-status").addClass("active");
|
$("#nav-link-status").addClass("active");
|
||||||
|
|||||||
Reference in New Issue
Block a user