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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user