Add types and altitudes to SIG Ref lookups

This commit is contained in:
Ian Renton
2026-08-14 14:57:48 +01:00
parent 605b629d43
commit e94d4bd927
29 changed files with 69 additions and 23 deletions
+10 -1
View File
@@ -26,11 +26,20 @@ class ZLOTA(FileDownloadSIGRefDataProvider):
longitude = ref["longitude"]
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("/", "_"),
latitude=latitude,
longitude=longitude)
# Check lat/lon validity and update grid accordingly
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)
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest