2025-01-15 22:20:14 +01:00
|
|
|
/**
|
|
|
|
* plan de conversion des clés du jeu de données vers les tags OSM
|
|
|
|
* détail dans le tableau
|
|
|
|
* https://wiki.openstreetmap.org/wiki/France/data.gouv.fr/Bornes_de_Recharge_pour_V%C3%A9hicules_%C3%89lectriques
|
2025-04-28 22:58:01 +02:00
|
|
|
*
|
|
|
|
* exemple d'exécution de script:
|
|
|
|
* npx ts-node convert_to_osm_tags.ts --source="etalab_data/irve_bornes_recharge/latest.json" --output-file="irve-latest.geojson" --engine-config=mappingConfigIRVE --wget
|
2025-01-15 22:20:14 +01:00
|
|
|
*/
|
|
|
|
import MappingConfigType from "../mapping-config.type";
|
|
|
|
|
|
|
|
const MappingIRVE: MappingConfigType = {
|
|
|
|
config_name: "IRVE config",
|
|
|
|
config_author: "tykayn <contact@cipherbliss.com>",
|
|
|
|
default_properties_of_point: {
|
|
|
|
'amenity': 'charging_station'
|
|
|
|
},
|
|
|
|
source: {
|
2025-04-28 22:58:01 +02:00
|
|
|
geojson_path: "https://www.data.gouv.fr/fr/datasets/r/7eee8f09-5d1b-4f48-a304-5e99e8da1e26",
|
|
|
|
url: 'https://www.data.gouv.fr/fr/datasets/r/7eee8f09-5d1b-4f48-a304-5e99e8da1e26',
|
|
|
|
documentation_url: 'https://transport.data.gouv.fr/datasets/fichier-consolide-des-bornes-de-recharge-pour-vehicules-electriques',
|
|
|
|
overpass_query: '[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="charging_station"](area.searchArea);out+geom;'
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
/**
|
|
|
|
* select only certain points from the source
|
|
|
|
*/
|
|
|
|
filters: {
|
2025-04-11 15:53:23 +02:00
|
|
|
// offset: 10, // limiter à une feature pour faire des tests
|
2025-01-15 22:20:14 +01:00
|
|
|
enable_coordinates_filter: false,
|
|
|
|
enable_properties_filter: true,
|
2025-03-13 11:51:47 +01:00
|
|
|
// filter_points_older_than_year: 2024,
|
|
|
|
// filter_points_by_year_property: 'date_mise_en_service',
|
2025-05-13 23:59:21 +02:00
|
|
|
// filter_points_lesser_than_NkW: 20 // ne pas sortir les points qui ont moins de ce nombre de puissance nominale
|
2025-01-15 22:20:14 +01:00
|
|
|
// add only geojson points who are found having this regex in the zipcode properties
|
|
|
|
// properties: {
|
|
|
|
// consolidated_code_postal: '^[76|27]'
|
|
|
|
// },
|
|
|
|
// bounding_box: [
|
|
|
|
// {}
|
|
|
|
// ]
|
|
|
|
},
|
|
|
|
add_not_mapped_tags_too: false,
|
|
|
|
boolean_keys: [
|
|
|
|
"prise_type_ef",
|
2025-04-17 17:34:39 +02:00
|
|
|
"prise_type_e",
|
|
|
|
"prise_type2",
|
2025-01-15 22:20:14 +01:00
|
|
|
"prise_type_2",
|
2025-04-17 17:34:39 +02:00
|
|
|
"prise_type_3",
|
2025-01-15 22:20:14 +01:00
|
|
|
"prise_type_combo_ccs",
|
|
|
|
"prise_type_chademo",
|
|
|
|
"gratuit",
|
|
|
|
"paiement_acte",
|
|
|
|
"paiement_cb",
|
2025-05-13 23:59:21 +02:00
|
|
|
"cable_t2_attache",
|
|
|
|
"socket:typee",
|
|
|
|
"socket:type2_combo",
|
|
|
|
"socket:chademo",
|
|
|
|
"socket:type2",
|
|
|
|
"socket:type2_cable",
|
2025-01-15 22:20:14 +01:00
|
|
|
],
|
|
|
|
tags: {
|
|
|
|
// ******* nombres
|
|
|
|
nbre_pdc: 'capacity',
|
|
|
|
// ******* textes
|
|
|
|
amenity: 'amenity', // conserver le tag de base
|
|
|
|
capacity: 'capacity', // conserver le tag de base
|
|
|
|
nom_amenageur: 'operator',
|
|
|
|
siren_amenageur: 'owner:ref:FR:SIREN',
|
|
|
|
nom_operateur: 'operator',
|
|
|
|
telephone_operateur: {
|
|
|
|
key_converted: 'operator:phone',
|
|
|
|
convert_to_phone: true, // conversion en format international si possible
|
|
|
|
},
|
|
|
|
phone: {
|
|
|
|
key_converted: 'operator:phone',
|
|
|
|
convert_to_phone: true, // conversion en format international si possible
|
|
|
|
},
|
2025-04-10 12:53:03 +02:00
|
|
|
contact_operateur: 'operator:email',
|
2025-01-15 22:20:14 +01:00
|
|
|
|
|
|
|
id_station_itinerance: {
|
|
|
|
key_converted: 'ref:EU:EVSE',
|
|
|
|
remove_stars: true,
|
2025-04-10 12:53:03 +02:00
|
|
|
truncate_enums_to_limit: 255,
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
id_station_local: 'ref',
|
|
|
|
|
|
|
|
/**
|
|
|
|
* l'info de gratuité a été mal renseignée par les opérateurs, ils mettent TRÈS souvent que c'est gratuit alors que ce n'est pas vrai.
|
|
|
|
*/
|
|
|
|
gratuit: {
|
|
|
|
key_converted: 'fee',
|
|
|
|
convert_to_boolean_value: true,
|
|
|
|
invert_boolean_value: true,
|
|
|
|
},
|
|
|
|
paiement_acte:
|
2025-02-24 14:53:42 +01:00
|
|
|
{
|
|
|
|
key_converted: 'authentication:none',
|
2025-05-13 23:59:21 +02:00
|
|
|
convert_to_boolean_value: true,
|
2025-01-15 22:20:14 +01:00
|
|
|
|
2025-02-24 14:53:42 +01:00
|
|
|
},
|
2025-01-15 22:20:14 +01:00
|
|
|
reservation: {
|
2025-04-10 12:53:03 +02:00
|
|
|
key_converted: 'reservation',
|
2025-05-13 23:59:21 +02:00
|
|
|
convert_to_boolean_value: true,
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
// observations: 'note',
|
|
|
|
nom_station: 'description',
|
|
|
|
nom_enseigne: 'network',
|
|
|
|
|
|
|
|
// ******* dates
|
|
|
|
date_mise_en_service: 'start_date',
|
|
|
|
// date_maj: 'source:date',
|
|
|
|
|
|
|
|
|
|
|
|
// ******** champs booléens
|
|
|
|
cable_t2_attache: {
|
|
|
|
key_converted: 'socket:type2_cable',
|
|
|
|
// socket:type2_cable vaut 1 dans OSM si vrai
|
|
|
|
truthy_value: '1',
|
|
|
|
ignore_if_falsy: true,
|
|
|
|
}
|
|
|
|
,
|
|
|
|
prise_type_ef: {
|
|
|
|
key_converted: 'socket:typee',
|
2025-05-13 23:59:21 +02:00
|
|
|
keep_only_truthy_yes_or_no_without_enum: true,
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
prise_type_2: {
|
|
|
|
key_converted: 'socket:type2',
|
2025-05-13 23:59:21 +02:00
|
|
|
// on convertit en yes ou no, sans enum, et on ne garde que si on obtient "yes"
|
|
|
|
keep_only_truthy_yes_or_no_without_enum: true,
|
|
|
|
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
prise_type_combo_ccs: {
|
|
|
|
key_converted: 'socket:type2_combo',
|
2025-05-13 23:59:21 +02:00
|
|
|
keep_only_truthy_yes_or_no_without_enum: true,
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
prise_type_chademo: {
|
|
|
|
key_converted: 'socket:chademo',
|
2025-05-13 23:59:21 +02:00
|
|
|
keep_only_truthy_yes_or_no_without_enum: true,
|
2025-01-15 22:20:14 +01:00
|
|
|
},
|
|
|
|
// ******** champs plus complexes
|
|
|
|
horaires: 'opening_hours', // déjà au bon format, enfin, en général. vérifier avec le validateur josm.
|
2025-04-10 12:53:03 +02:00
|
|
|
tarification: 'charge',
|
2025-01-15 22:20:14 +01:00
|
|
|
paiement_cb: {
|
|
|
|
key_converted: 'payment:credit_cards',
|
|
|
|
// ignore_if_falsy: true,
|
|
|
|
convert_to_boolean_value: true,
|
|
|
|
},
|
|
|
|
accessibilite_pmr: {
|
|
|
|
key_converted: "wheelchair",
|
|
|
|
conditional_values: {
|
2025-05-13 23:59:21 +02:00
|
|
|
|
2025-01-15 22:20:14 +01:00
|
|
|
"Accessible mais non réservé PMR": {
|
|
|
|
value_converted: "yes"
|
|
|
|
},
|
|
|
|
"Réservé PMR": {
|
|
|
|
value_converted: "yes"
|
|
|
|
},
|
|
|
|
"Non accessible": {
|
|
|
|
value_converted: "no"
|
|
|
|
},
|
|
|
|
"Mo-Fr 08:30-12:00,Mo-Fr 14:00-19:00,Sat 09:00-18:30": {
|
|
|
|
value_converted: "Mo-Fr 08:30-12:00,Mo-Fr 14:00-19:00,Sat 09:00-18:30"
|
|
|
|
},
|
|
|
|
// On précise que l'on veut conserver cette valeur, par défaut tout ce qui n'est pas précisé en valeur conditionnelle n'est pas conservé
|
|
|
|
"24/7": {
|
|
|
|
value_converted: "24/7"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
station_deux_roues: {
|
|
|
|
remove_original_key: true,
|
|
|
|
conditional_values: {
|
|
|
|
// ajout de trois tags si la valeur est yes
|
|
|
|
"yes": {
|
|
|
|
tags_to_add: [
|
2025-02-24 14:53:42 +01:00
|
|
|
{ bicycle: "yes" },
|
|
|
|
{ scooter: "yes" },
|
|
|
|
{ motorcar: "no" },
|
2025-01-15 22:20:14 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
puissance_nominale: {
|
|
|
|
key_converted: 'charging_station:output',
|
|
|
|
socket_output_find_correspondances: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MappingIRVE;
|