Use fallback if Scottish civil parish lookup fails

This commit is contained in:
Edward Betts 2023-12-27 15:06:14 +00:00
parent 9112c685c4
commit 88d46c1dcd

View file

@ -114,6 +114,7 @@ def lat_lon_to_wikidata(lat: float, lon: float) -> dict[str, typing.Any]:
elements = []
result = wikidata.build_dict(hit, lat, lon)
if not result.get("missing"):
return {"elements": elements, "result": result}
elements = model.Polygon.coords_within(lat, lon)