fix(skills): use is None check for coordinates in find-nearby to avoid dropping valid 0.0 values

This commit is contained in:
Misturi 2026-04-15 08:54:33 +01:00 committed by Teknium
parent 2546b7acea
commit 8bc9b5a0b4

View file

@ -98,7 +98,7 @@ def find_nearby(lat: float, lon: float, types: list[str], radius: int = 1500, li
# Get coordinates (nodes have lat/lon directly, ways/relations use center) # Get coordinates (nodes have lat/lon directly, ways/relations use center)
plat = el.get("lat") or (el.get("center", {}) or {}).get("lat") plat = el.get("lat") or (el.get("center", {}) or {}).get("lat")
plon = el.get("lon") or (el.get("center", {}) or {}).get("lon") plon = el.get("lon") or (el.get("center", {}) or {}).get("lon")
if not plat or not plon: if plat is None or plon is None:
continue continue
dist = haversine(lat, lon, plat, plon) dist = haversine(lat, lon, plat, plon)