add script find bad stations

This commit is contained in:
Tykayn 2025-06-27 14:24:37 +02:00 committed by tykayn
parent db76768bd9
commit a1677fff21
6 changed files with 668 additions and 3 deletions

View file

@ -4,7 +4,7 @@
fait avec le données OpenStreetMap (OSM) ainsi que des icones
![libre-charge-map_popup.jpg](libre-charge-map_popup.jpg)
Venez discuter sur le forum OpenStreetMap: https://forum.openstreetmap.org/viewtopic.php?id=69882
Venez discuter sur le forum OpenStreetMap: https://forum.openstreetmap.fr/t/libre-charge-map/29522
développé par tykayn - https://www.cipherbliss.com - à partir d'un squelette d'example pour Leaflet.
Mastodon: https://mastodon.cipherbliss.com/@tykayn

View file

@ -0,0 +1,582 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1865684,
47.3575924
]
},
"properties": {
"id": 3090954095,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"brand": "Energieversorgung Kleinwalsertal GesmbH",
"capacity": "2",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"description": "EVK Stromtankstelle",
"motorcar": "yes",
"note": "Nur EIN ausgewiesener Parkplatz für 2 Ladepunkte, Nachbarplätze sind Kundenparkplätze des Trachtengeschäfts. „Säule frei“-Anzeige einiger Apps kann daher irreführend sein.",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Allgäuer Überlandwerk, Kempten",
"operator:wikidata": "Q994822",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
-71.1836614,
42.4021001
]
},
"properties": {
"id": 9587696282,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"brand": "Clipper Creek",
"capacity": "2",
"fee": "no",
"no:network": "true",
"parking:fee": "no",
"socket:type1": "2",
"socket:type1:current": "40",
"socket:type1:voltage": "240"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.184104,
47.355717
]
},
"properties": {
"id": 11364527811,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1674819,
47.3422934
]
},
"properties": {
"id": 11364527812,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1649945,
47.3420134
]
},
"properties": {
"id": 11364527813,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1873576,
47.3589524
]
},
"properties": {
"id": 11364528646,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"capacity": "3",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.16734,
47.325325
]
},
"properties": {
"id": 11364540630,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.447047,
47.572372
]
},
"properties": {
"id": 11364555160,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.191106,
47.369248
]
},
"properties": {
"id": 11364557400,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.146609,
47.317868
]
},
"properties": {
"id": 11364567892,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.138289,
47.342494
]
},
"properties": {
"id": 11364569786,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.16778,
47.327719
]
},
"properties": {
"id": 11364569821,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1588039,
47.3287535
]
},
"properties": {
"id": 11364571632,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1864801,
47.3606676
]
},
"properties": {
"id": 11364579029,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"capacity": "4",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.152386,
47.323295
]
},
"properties": {
"id": 11364594522,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
10.1552387,
47.3238845
]
},
"properties": {
"id": 11364594754,
"type": "node",
"tags": {
"access": "yes",
"amenity": "charging_station",
"contact:email": "stromtanken@evk.at",
"contact:phone": "+43551752040",
"contact:website": "https://www.evk.at",
"opening_hours": "Mo-Su 00:00-24:00",
"operator": "Energieversorgung Kleinwalsertal GesmbH",
"public": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
0.9609877,
49.5361702
]
},
"properties": {
"id": 12745498467,
"type": "node",
"tags": {
"amenity": "charging_station",
"authentication:none": "yes",
"capacity": "2",
"charge": "0,39€ / kWh;0,29€ / kWh",
"charging_station:output": "120 kW",
"description": "BARENTIN Curie",
"fee": "yes",
"network": "LIDL",
"opening_hours": "24/7",
"operator": "LIDL France",
"operator:email": "bornes@lidl.fr",
"operator:phone": "+33 1 59 20 06 84",
"owner:ref:FR:SIREN": "343262622",
"payment:credit_cards": "no",
"ref": "LFR3107EVCP01;LFR3107EVCP02",
"ref:EU:EVSE": "LFR3107EVCP01;LFR3107EVCP02",
"reservation": "no",
"socket:type2": "true",
"socket:type2_combo": "true",
"socket:type2_combo:output": "120 kW",
"socket:typee": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
0.9630353,
49.5358693
]
},
"properties": {
"id": 12745498468,
"type": "node",
"tags": {
"amenity": "charging_station",
"authentication:none": "yes",
"capacity": "3",
"charging_station:output": "150 kW",
"description": "IZIVIA FAST - MCDONALDS - ROUEN BARENTIN",
"fee": "yes",
"network": "IZIVIA FAST",
"opening_hours": "24/7",
"operator": "IZIVIA",
"operator:email": "sav@izivia.com",
"operator:phone": "+33 9 72 66 80 01",
"owner:ref:FR:SIREN": "951478437",
"payment:credit_cards": "no",
"ref": "FR*SOD*S*FAST*104*2*_*_;FR*SOD*S*FAST*104*1*_*_",
"ref:EU:EVSE": "FRIZFPFAST10423;FRIZFPFAST10413;FRIZFPFAST10411;FRIZFPFAST10412;FRIZFPFAST10421;FRIZFPFAST10422",
"reservation": "no",
"socket:type2": "true",
"socket:type2_combo": "true",
"socket:type2_combo:output": "150 kW",
"start_date": "2024-04-29"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
1.0762172,
49.8938083
]
},
"properties": {
"id": 12754780739,
"type": "node",
"tags": {
"amenity": "charging_station",
"authentication:none": "yes",
"capacity": "2",
"charge": "0,39€ / kWh;0,29€ / kWh",
"charging_station:output": "120 kW;22 kW",
"description": "ST AUBIN SUR SCIE Pointe",
"fee": "yes",
"network": "LIDL",
"opening_hours": "24/7",
"operator": "LIDL France",
"operator:email": "bornes@lidl.fr",
"operator:phone": "+33 1 59 20 06 84",
"owner:ref:FR:SIREN": "343262622",
"payment:credit_cards": "no",
"ref": "LFR3632EVCP01;LFR3632EVCP02",
"ref:EU:EVSE": "LFR3632EVCP01;LFR3632EVCP02",
"reservation": "no",
"socket:type2": "true",
"socket:type2_combo": "true",
"socket:type2_combo:output": "120 kW",
"socket:typee": "true"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
0.9674833,
49.5354211
]
},
"properties": {
"id": 1375967215,
"type": "way",
"tags": {
"amenity": "charging_station",
"authentication:none": "yes",
"capacity": "10",
"charge": "HPC 49cts/Kwh ;HPC 59cts/Kwh ;AC 36cts/KWh",
"charging_station:output": "300 kW",
"description": "BARENTIN",
"fee": "yes",
"network": "Carrefour Energies",
"opening_hours": "24/7",
"operator": "Allego",
"operator:email": "fabien.lepeytre@allego.eu",
"operator:phone": "+33 6 22 53 03 38",
"owner:ref:FR:SIREN": "895163608",
"payment:credit_cards": "yes",
"ref:EU:EVSE": "FRALLPEVCARSBRTIN",
"reservation": "no",
"socket:chademo": "true",
"socket:type2": "true",
"socket:type2_combo": "true",
"socket:type2_combo:output": "300 kW;150 kW",
"socket:typee": "true",
"start_date": "2022-09-21",
"wheelchair": "yes"
}
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
0.9674339,
49.5356273
]
},
"properties": {
"id": 1375967231,
"type": "way",
"tags": {
"amenity": "charging_station",
"authentication:none": "yes",
"brand": "Carrefour Énergies",
"capacity": "11",
"description": "Allego Allego - Carrefour Barentin",
"fee": "yes",
"network": "Allego Allego - Carrefour Barentin",
"opening_hours": "24/7",
"operator": "Allego",
"operator:email": "info@allego.eu",
"operator:phone": "+33 8 00 78 19 2",
"payment:credit_cards": "yes",
"ref": "FRALLEGO9003302;FRALLEGO9002401;FRALLEGO9002392;FRALLEGO9002391;FRALLEGO9000072;FRALLEGO9000071;FRALLEGO9000061;FRALLEGO9000062;FRALLEGO9002402;FRALLEGO9002403;FRALLEGO9003301",
"ref:EU:EVSE": "FRALLEGO9002392;FRALLEGO9002391;FRALLEGO9000072;FRALLEGO9000071;FRALLEGO9000061;FRALLEGO9000062;FRALLEGO9002401;FRALLEGO9002402;FRALLEGO9002403;FRALLEGO9003301;FRALLEGO9003302",
"reservation": "no",
"socket:chademo": "true",
"socket:type2": "true",
"socket:type2_combo": "true",
"start_date": "2022-09-22"
}
}
}
]
}

71
find_bad_stations.js Normal file
View file

@ -0,0 +1,71 @@
import fetch from 'node-fetch';
import fs from 'fs';
const overpassUrl = 'https://overpass-api.de/api/interpreter';
const query = `[out:json][timeout:180];
(
node["amenity"="charging_station"];
way["amenity"="charging_station"];
relation["amenity"="charging_station"];
);
out body tags center;`;
function hasTrueFalseTag(tags) {
return Object.values(tags).some(v => v === 'true' || v === 'false');
}
async function main() {
console.log('Envoi de la requête Overpass...');
const response = await fetch(overpassUrl, {
method: 'POST',
body: `data=${encodeURIComponent(query)}`,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
if (!response.ok) {
throw new Error(`Erreur Overpass: ${response.status} ${response.statusText}`);
}
const data = await response.json();
const features = [];
for (const el of data.elements) {
const tags = el.tags || {};
if (!hasTrueFalseTag(tags)) continue;
let coords;
if (el.type === 'node') {
coords = [el.lon, el.lat];
} else if ((el.type === 'way' || el.type === 'relation') && el.center) {
coords = [el.center.lon, el.center.lat];
} else {
continue;
}
features.push({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: coords
},
properties: {
id: el.id,
type: el.type,
tags: tags
}
});
}
const geojsonObj = {
type: 'FeatureCollection',
features: features
};
fs.writeFileSync('charging_stations_true_false.geojson', JSON.stringify(geojsonObj, null, 2), 'utf8');
console.log(`Fichier GeoJSON écrit avec ${features.length} objets.`);
}
main().catch(err => {
console.error(err);
process.exit(1);
});

View file

@ -15,7 +15,7 @@ const lcm_utils = {
* Deviner aussi les puissances non déclarées:
* - type 2 présent, max 43kW
* - type Chademo présent, max 63kW
* https://forum.openstreetmap.fr/t/bornes-de-recharges-et-puissance-chargeurs-quel-est-votre-avis/27828
* https://forum.openstreetmap.fr/t/libre-charge-map/29522
*
* @param feature
* @returns {number}

11
package-lock.json generated
View file

@ -9,6 +9,7 @@
"version": "0.5.0",
"dependencies": {
"cheerio": "^1.0.0",
"geojson": "^0.5.0",
"node-fetch": "^3.3.2",
"sass": "^1.87.0"
},
@ -4409,6 +4410,15 @@
"node": ">=6.9.0"
}
},
"node_modules/geojson": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/geojson/-/geojson-0.5.0.tgz",
"integrity": "sha512-/Bx5lEn+qRF4TfQ5aLu6NH+UKtvIv7Lhc487y/c8BdludrCTpiWf9wyI0RTyqg49MFefIAvFDuEi5Dfd/zgNxQ==",
"license": "MIT",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@ -6599,6 +6609,7 @@
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
"license": "MIT",
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",

View file

@ -38,7 +38,8 @@
},
"dependencies": {
"cheerio": "^1.0.0",
"geojson": "^0.5.0",
"node-fetch": "^3.3.2",
"sass": "^1.87.0"
}
}
}