mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Fix some location handling bugs
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import copy
|
import copy
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@@ -220,7 +221,10 @@ class Spot:
|
|||||||
self.dx_latitude = ll[0]
|
self.dx_latitude = ll[0]
|
||||||
self.dx_longitude = ll[1]
|
self.dx_longitude = ll[1]
|
||||||
if self.dx_latitude and self.dx_longitude and not self.dx_grid:
|
if self.dx_latitude and self.dx_longitude and not self.dx_grid:
|
||||||
|
try:
|
||||||
self.dx_grid = latlong_to_locator(self.dx_latitude, self.dx_longitude, 8)
|
self.dx_grid = latlong_to_locator(self.dx_latitude, self.dx_longitude, 8)
|
||||||
|
except:
|
||||||
|
logging.debug("Invalid lat/lon received for spot")
|
||||||
if self.dx_latitude:
|
if self.dx_latitude:
|
||||||
self.dx_location_source = "SPOT"
|
self.dx_location_source = "SPOT"
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class ParksNPeaks(HTTPSpotProvider):
|
|||||||
for row in siota_dr:
|
for row in siota_dr:
|
||||||
if row["SILO_CODE"] == spot.sig_refs[0]:
|
if row["SILO_CODE"] == spot.sig_refs[0]:
|
||||||
spot.dx_latitude = float(row["LAT"])
|
spot.dx_latitude = float(row["LAT"])
|
||||||
spot.dx_longitude = float(row["LON"])
|
spot.dx_longitude = float(row["LNG"])
|
||||||
spot.dx_grid = row["LOCATOR"]
|
spot.dx_grid = row["LOCATOR"]
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user