Fix some dodgy handling of DME references

This commit is contained in:
Ian Renton
2026-09-05 09:57:05 +01:00
parent 3e4327ec0c
commit df724409a5
11 changed files with 28 additions and 20 deletions
+5 -1
View File
@@ -23,7 +23,11 @@ class DME(LocalFileSIGRefDataProvider):
new_data = []
with open(path, encoding="latin-1") as _f:
for row in csv.DictReader(_f, delimiter=";"):
ref_id = row["COD_INE"][:5]
# Store reference IDs with the "DME-" prefix rather than just the number. This will prevent Spothole
# from agressively thinking every number in a spot comment is DME after it's seen "DME" once. The only
# numbers that count are straight after "DME " or "DME-". The dash versus space is normalised in
# sig_lookup_helper.py.
ref_id = "DME-" + row["COD_INE"][:5]
latitude = (
float(row["LATITUD_ETRS89_REGCAN95"].replace(",", "."))
if row.get("LATITUD_ETRS89_REGCAN95")