Hi,
I’m using OSM to optimize a somewhat lenghty roadtrip around southern Europe. Waypoint names (exclusively Tesla Superchargers) are fed into a local script that pulls GPS coordinates via nominatim, stores these to a local JSON file, and then I do things with it. Most of my waypoints do work right away, some just had not enough data on OSM so I’ve added and expanded these entries, some need a bit of rework on my side for whatever reason (e.g. removal of the country, which is part of the supercharger name), and some still cannot be found despite suitable (?) edits.
The number of duds is pretty small, so I could just get away with manually pulling GPS coordinates and edit my local cache, but I’d like to understand why that happens and if I can work around or improve things, so that other people can pull correct data in the future.
These are the four waypoints that I cannot get OSM to locate:
Supercharger Nîmes, France – Nimotel: OpenStreetMap / www.tesla. com/en_eu/findus?location=Self-ServeDemoDrive
Supercharger Aire des Portes d’Angers, France: OpenStreetMap / www.tesla. com/en_eu/findus?location=portesdangerssupercharger
Supercharger Saint-Pierre-d’Irube, France: OpenStreetMap / www.tesla. com/en_eu/findus?location=30243
Supercharger Aire de Vidauban Sud, France: www.openstreetmap. org/#map=19/43.413961/6.451190 / www.tesla. com/en_eu/findus?location=vidaubanfrsupercharger
(you need to fix these links yourself, a new user can only add three…
)
The Nimotel one can be found by omitting the Supercharger part, which is a) a special case since few locations are tagged with street names or other POI, and b) if searching for the actual Nimotel hotel nearby, it cannot be found, as OSM only references the charging station.
An example where searching for the full street name fails would be “(Supercharger) Offenburg, Germany - Wilhelm-Röntgen-Straße” - this only resolves when omitting the “Germany” part, although the street name should be known to OSM. Having the country name in literally over 100 other queries works perfectly fine, but this one refuses to resolve once Germany is mentioned. Removing the country can lead to other issues, e.g. with Supercharger Orange, France and Supercharger Saint-Louis, France, when Orange and Saint-Louis are located in the US instead.
So my question would be how to debug this and find the “correct” name or combination of fields to populate without making tons of experimental edits and database queries..?
MWE (python code)
# Requirements: pip install geopy folium tqdm
from geopy.geocoders import Nominatim
from geopy.extra.rate_limiter import RateLimiter
import folium
from tqdm import tqdm
import json
import os
places = [
"Supercharger Füssen, Germany",
"Supercharger St. Anton, Austria",
"Supercharger Schaan, Liechtenstein",
"Supercharger Bressanone, Italy",
"Supercharger Aix-en-Provence, France - Beaumanoir",
"Supercharger Xinzo de Limia, Spain",
"Supercharger Fátima, Portugal",
"Supercharger Offenburg, Germany – Wilhelm-Röntgen-Straße",
"Supercharger Valencia, Spain – Paterna",
"Supercharger Nîmes, France – Nimotel",
"Supercharger Aire des Portes d'Angers, France",
"Supercharger Saint-Pierre-d'Irube, France",
"Supercharger Aire de Vidauban Sud, France"
]
geolocator = Nominatim(user_agent="southern_europe_route_map")
geocode = RateLimiter(geolocator.geocode, min_delay_seconds=1, swallow_exceptions=True)
CACHE_FILE = "geocode_cache.json"
if os.path.exists(CACHE_FILE):
with open(CACHE_FILE, "r", encoding="utf-8") as f:
cache = json.load(f)
else:
cache = {}
def resolve_place(name):
if name in cache:
return cache[name]
result = geocode(name)
if result is None:
simplified = name.split(" - ")[0].replace("Northbound", "").replace("Route Nationale", "").strip()
result = geocode(simplified)
if result:
cache[name] = {"lat": result.latitude, "lon": result.longitude}
with open(CACHE_FILE, "w", encoding="utf-8") as f:
json.dump(cache, f, ensure_ascii=False, indent=2)
return result
else:
cache[name] = None
with open(CACHE_FILE, "w", encoding="utf-8") as f:
json.dump(cache, f, ensure_ascii=False, indent=2)
return None
coords = []
for p in tqdm(places, desc="Geocoding"):
r = resolve_place(p)
if r is not None:
coords.append((r["lat"] if isinstance(r, dict) else r.latitude,
r["lon"] if isinstance(r, dict) else r.longitude))
m = folium.Map(location=[43, 0], zoom_start=6, tiles="OpenStreetMap")
for lat, lon in coords:
folium.CircleMarker(
location=[lat, lon],
radius=3,
color="#1f6feb",
fill=True,
fill_color="#1f6feb",
fill_opacity=0.9
).add_to(m)
folium.PolyLine(coords, color="#d73a49", weight=2, opacity=0.9).add_to(m)
m.save("southern_europe_route.html")


