Charging stations coordinate may be outside of the specified country, due to wrong geocoding, wrong address or other problems. So as a post-processing step, all charging stations for a country should be checked if they are really within the boundaries.
E.g. we can import a polygon for Germany into the DB and perform the check via a PostGIS function.
- Download Polygon via Overpass like we do for OSM charging stations, i.e. just query for the areas like we have already defined
e.g. area['name'='Deutschland'];
rel(pivot);
out geom;
- Convert to GeoJson / Geopandas and write to Postgis
- Check via Postgis ST_Within(charging_station, area) if a charging station is within the requested area