Reject lat/longs within 0.1deg latitude of the poles. These are almost always a result of someone having a default grid of "AA00AA" set. Apologies to any hams at the Amundsen-Scott research station.

This commit is contained in:
Ian Renton
2025-12-17 10:07:35 +00:00
parent ac9e2ff054
commit 040ef3ec00

View File

@@ -358,10 +358,12 @@ class LookupHelper:
# Coordinates that look default are rejected (apologies if your position really is 0,0, enjoy your voyage) # Coordinates that look default are rejected (apologies if your position really is 0,0, enjoy your voyage)
def infer_latlon_from_callsign_online_lookup(self, call): def infer_latlon_from_callsign_online_lookup(self, call):
data = self.get_qrz_data_for_callsign(call) data = self.get_qrz_data_for_callsign(call)
if data and "latitude" in data and "longitude" in data and (data["latitude"] != 0 or data["longitude"] != 0): if data and "latitude" in data and "longitude" in data and (data["latitude"] != 0 or data["longitude"] != 0) and -89.9 < \
data["latitude"] < 89.9:
return [data["latitude"], data["longitude"]] return [data["latitude"], data["longitude"]]
data = self.get_hamqth_data_for_callsign(call) data = self.get_hamqth_data_for_callsign(call)
if data and "latitude" in data and "longitude" in data and (data["latitude"] != 0 or data["longitude"] != 0): if data and "latitude" in data and "longitude" in data and (data["latitude"] != 0 or data["longitude"] != 0) and -89.9 < \
data["latitude"] < 89.9:
return [data["latitude"], data["longitude"]] return [data["latitude"], data["longitude"]]
else: else:
return None return None