déménagement du mappeur

https://forge.chapril.org/tykayn/mapping-geojson-osm

Signed-off-by: tykayn <contact@cipherbliss.com>
This commit is contained in:
tykayn 2023-08-11 20:53:37 +02:00
parent e07eb5c853
commit 06f5f1bb1b
209 changed files with 487 additions and 10077638 deletions

468
license-osm/index.html Normal file
View File

@ -0,0 +1,468 @@
<!DOCTYPE html>
<html dir="ltr" lang="fr">
<head data-locale="fr"
data-location="{&quot;minlon&quot;:-5.142222,&quot;minlat&quot;:41.371582,&quot;maxlon&quot;:9.561556,&quot;maxlat&quot;:51.092804}"
data-preferred-editor="remote"
data-user="2962129"
data-user-home="{&quot;lat&quot;:48.6246,&quot;lon&quot;:2.124}">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<!-- <script src="https://www.openstreetmap.org/assets/application-57cd01faad75101f62e68d5f3bb3c1f019aeb72d3418a41b8b251be58fc09df2.js"></script>-->
<!-- <script src="https://www.openstreetmap.org/assets/i18n/fr-05ae7302303275076d6ae97c266a9bcb5b3a518ca4e009b707d61f59649b0200.js"></script>-->
<link href="https://www.openstreetmap.org/assets/screen-ltr-ca0aa65af2fe5fbc646694d87d9b5d73d80c1e27ba166ad1b99a297bccc1f756.css"
media="screen"
rel="stylesheet">
<link href="https://www.openstreetmap.org/assets/print-ltr-43899a8d8a55e0f65e57a89b7de420a34e64888beead34a1ac0e2530be9b6369.css"
media="print"
rel="stylesheet">
<link href="https://www.openstreetmap.org/assets/leaflet-all-874f5f3b37bd0e0e69acaf01dd25772af42be74da2e51025b131799d43107685.css"
media="screen, print"
rel="stylesheet">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-57x57-0af2b52ac2b1a8cb0aba42f17aa901bfdedb9174bd978f838e3b3e1dd8602f52.png"
rel="apple-touch-icon"
sizes="57x57"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-60x60-cff74c9066d8e7fd08b29407712edbae5613cc9a4c03ee0398a89502a6a41d1f.png"
rel="apple-touch-icon"
sizes="60x60"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-72x72-63c6fdf3ddf65feebac1c0441bf6a378d1e4bde7107f598ae86733c402895eae.png"
rel="apple-touch-icon"
sizes="72x72"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-76x76-1740d6e7a59521693c496dd8fbe1caf3d5ad302017cb0f5073b6914b4f5b7544.png"
rel="apple-touch-icon"
sizes="76x76"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-114x114-20ba9df1a8f9b341040d661b7942b7b10288b9b4c4ce0663e10018958dc7f4a8.png"
rel="apple-touch-icon"
sizes="114x114"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-120x120-c304991e604d1be82639709b96fb87f7b6b6688cc0d04d5f6141604259299648.png"
rel="apple-touch-icon"
sizes="120x120"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-144x144-fbf20bdf9d2f7c1fe8eb85d7869a9bda285be88c93a39438150f5eb5955758ce.png"
rel="apple-touch-icon"
sizes="144x144"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-152x152-af45dc979e972cab863517b2cb33a3dcf3e04e02a2eb2734c6f93edc21fa395d.png"
rel="apple-touch-icon"
sizes="152x152"
type="image/png">
<link href="https://www.openstreetmap.org/assets/apple-touch-icon-180x180-ea6361d7ae5b3f08c6290652ad703fa239364cc09c84873044f3299845f24652.png"
rel="apple-touch-icon"
sizes="180x180"
type="image/png">
<link href="https://www.openstreetmap.org/assets/favicon-32x32-99b88fcadeef736889823c8a886b89d8cada9d4423a49a27de29bacc0a6bebd1.png"
rel="icon"
sizes="32x32"
type="image/png">
<link href="https://www.openstreetmap.org/assets/favicon-194x194-79d3fb0152c735866e64b1d7535d504483cd13c2fad0131a6142bd9629d30de2.png"
rel="icon"
sizes="194x194"
type="image/png">
<link href="https://www.openstreetmap.org/assets/favicon-96x96-6ffbc38962fddb870f9577b76430a0ee4db5fb4eca485f850cd45436d7f3eb87.png"
rel="icon"
sizes="96x96"
type="image/png">
<link href="https://www.openstreetmap.org/assets/android-chrome-192x192-f970b9be3965dfda6ea9481b305c39b2ec794e296f802235e30d4671f0f896e1.png"
rel="icon"
sizes="192x192"
type="image/png">
<link href="https://www.openstreetmap.org/assets/favicon-16x16-474476c1b2381628a81361a9e2bf04b936d21f77c59e84b48c6c69ea376fb6cf.png"
rel="icon"
sizes="16x16"
type="image/png">
<link color="#7ebc6f"
href="https://www.openstreetmap.org/assets/tab-icon-3e700a12d38a1bba06d674ed663824232025cd6b0ca5c439c846740a7468b302.svg"
rel="mask-icon">
<link href="https://www.openstreetmap.org/assets/manifest-b2cc1407226d3e16e6149425747239c259fbe44b41bff3aca36ca6d9e56a6e18.json"
rel="manifest">
<meta content="https://www.openstreetmap.org/assets/browserconfig-c59184dc0264731151cbf50ae58f7fa8ae5153138013f125203e1193800f862f.xml"
name="msapplication-config">
<meta content="#00a300" name="msapplication-TileColor">
<meta content="https://www.openstreetmap.org/assets/mstile-144x144-02723f6f7cb2c18e6f8041c93f80982decb52b24a7e447477bc2ce3136d75806.png"
name="msapplication-TileImage">
<meta content="#ffffff" name="theme-color">
<link href="https://www.openstreetmap.org/copyright" rel="canonical">
<link href="https://www.openstreetmap.org/assets/osm-42b7b3fbcee2193e455a773db6cd3d34a2f48ca94547fed54901dd9d8307b02b.xml"
rel="search" title="OpenStreetMap Search"
type="application/opensearchdescription+xml">
<meta content="OpenStreetMap is the free wiki world map." name="description">
<meta content="OpenStreetMap" property="og:site_name">
<meta content="OpenStreetMap" property="og:title">
<meta content="website" property="og:type">
<meta content="https://www.openstreetmap.org/assets/osm_logo_256-ed028f90468224a272961c380ecee0cfb73b8048b34f4b4b204b7f0d1097875d.png"
property="og:image">
<meta content="https://www.openstreetmap.org/assets/osm_logo_256-ed028f90468224a272961c380ecee0cfb73b8048b34f4b4b204b7f0d1097875d.png"
property="og:image:secure_url">
<meta content="https://www.openstreetmap.org/copyright" property="og:url">
<meta content="OpenStreetMap est une carte du monde, créée par des gens comme vous et libre dutilisation sous licence libre."
property="og:description">
<meta content="authenticity_token" name="csrf-param">
<meta content="cNrEDHe26Yx6WzoJM6HJe88pvmeHOFbQAcdEBBegYXh_VqjsJJHGIF30YGTlX05O_uMyr2OP49wIOIfObfj9dQ"
name="csrf-token">
<title>OpenStreetMap</title>
</head>
<body>
<div id="main">
<div id="content">
<header class="closed clearfix">
<h1>
<a ="https://www.openstreetmap.org/" class="geolink">
<picture>
<source srcset="/assets/osm_logo-4afddaae0230a5a46687fdc751ed256dfdccde144118cb02a7d7960f207a4b92.svg"
type="image/svg+xml">
<img alt="Logo dOpenStreetMap"
class="logo"
src="/assets/osm_logo-9391021d40a7acdafd2ac5d5622dfe0e469c61421fdb2975365c183f5edaa270.png"
srcset="/assets/osm_logo-4afddaae0230a5a46687fdc751ed256dfdccde144118cb02a7d7960f207a4b92.svg">
</picture>
OpenStreetMap
</a>
</h1>
<a href="#" id="menu-icon"></a>
<nav class="primary">
<div class="btn-group">
<div class="btn-group " id="edit_tab" title="Zoomez en avant pour modifier la carte">
<a class="btn btn-outline-primary geolink editlink" data-editor="remote" id="editanchor"
="https://www.openstreetmap.org/edit">Modifier</a>
<button class="btn btn-outline-primary dropdown-toggle dropdown-toggle-split"
data-bs-toggle="dropdown"
type="button"></button>
<ul class="dropdown-menu">
<li>
<a class="geolink editlink dropdown-item" data-editor="id" ="
https://www.openstreetmap.org/edit?editor=id">Modifier
avec iD (éditeur intégré au navigateur)</a>
</li>
<li>
<a class="geolink editlink dropdown-item" data-editor="remote"
="https://www.openstreetmap.org/edit?editor=remote">Modifier avec Éditeur externe (JOSM,
Potlatch,
Merkaartor)</a>
</li>
</ul>
</div>
<a class="btn btn-outline-primary geolink flex-grow-1 current_page_class(history_path)"
id="history_tab" ="https://www.openstreetmap.org/history">Historique</a>
<a class="btn btn-outline-primary geolink current_page_class(export_path)" id="export_tab"
="https://www.openstreetmap.org/export">Exporter</a>
</div>
</nav>
<nav class="secondary">
<ul class="mx-1 px-0">
<li class="compact-hide nav-item ">
<a class="nav-link" ="https://www.openstreetmap.org/traces">Traces GPS</a>
</li>
<li class="compact-hide nav-item ">
<a class="nav-link" ="https://www.openstreetmap.org/diary">Journaux des utilisateurs</a>
</li>
<li class="compact-hide nav-item ">
<a class="nav-link" ="https://www.openstreetmap.org/communities">Communautés</a>
</li>
<li class="compact-hide nav-item current">
<a class="nav-link" ="https://www.openstreetmap.org/copyright">Droits dauteur</a>
</li>
<li class="compact-hide nav-item ">
<a class="nav-link" ="https://www.openstreetmap.org/help">Aide</a>
</li>
<li class="compact-hide nav-item ">
<a class="nav-link" ="https://www.openstreetmap.org/about">À propos</a>
</li>
<li class="dropdown nav-item" id="compact-secondary-nav">
<button class="dropdown-toggle nav-link btn" data-bs-toggle="dropdown" type="button">Plus
</button>
<ul class="dropdown-menu">
<li class=""><a class="dropdown-item" ="https://www.openstreetmap.org/traces">Traces GPS</a>
</li>
<li class=""><a class="dropdown-item" ="https://www.openstreetmap.org/diary">Journaux des
utilisateurs</a></li>
<li class=""><a class="dropdown-item" ="https://www.openstreetmap.org/communities">
Communautés</a></li>
<li class="current"><a class="dropdown-item" ="https://www.openstreetmap.org/copyright">
Droits dauteur</a></li>
<li class=""><a class="dropdown-item" ="https://www.openstreetmap.org/help">Aide</a></li>
<li class=""><a class="dropdown-item" ="https://www.openstreetmap.org/about">À propos</a>
</li>
</ul>
</li>
</ul>
<div class="d-inline-flex dropdown user-menu logged-in clearfix">
<button class="dropdown-toggle btn btn-outline-secondary px-2 py-1 flex-grow-1"
data-bs-toggle="dropdown"
type="button">
<img alt="" class="user_thumbnail_tiny rounded-1"
height="50"
src="https://www.gravatar.com/avatar/c3b6c1aaf400b9240b9e361629f28b23.jpg?s=50&amp;d=https%3A%2F%2Fwww.openstreetmap.org%2Fassets%2Favatar_large-54d681ddaf47c4181b05dbfae378dc0201b393bbad3ff0e68143c3d5f3880ace.png"
width="50">
<span class="user-button">
<span class="username">
tykayn
</span>
</span>
</button>
<div class="dropdown-menu dropdown-menu-end">
<a class="dropdown-item" ="https://www.openstreetmap.org/dashboard">Mon tableau de bord</a>
<a class="dropdown-item" ="https://www.openstreetmap.org/messages/inbox">
Mes messages
<span class="count-number">0</span>
</a> <a class="dropdown-item" ="https://www.openstreetmap.org/user/tykayn">Mon profil</a>
<a class="dropdown-item" ="https://www.openstreetmap.org/account/edit">Mes options</a>
<a class="dropdown-item" ="https://www.openstreetmap.org/preferences">Mes préférences</a>
<div class="dropdown-divider"></div>
<a class="geolink dropdown-item" data-method="post" rel="nofollow"
="https://www.openstreetmap.org/logout?referer=%2Fcopyright">Se déconnecter</a>
</div>
</div>
</nav>
</header>
<div id="content">
<div class="content-inner">
<div class="lang-selector">
This page is also available in ENGLISH / FRANÇAIS / ...
<select id="lang" name="lang">
<option value="FR_fr">Français</option>
<option value="EN_en">English</option>
</select>
</div>
<article>
<div class="heading-box">
<h1 id="head">
<!-- noun-heart-5454846-->
OpenStreetMap : la base de données cartographique ouverte, collaborative et mondiale
</h1>
<p>
</p>
Chacun est libre de contribuer et dutiliser les données à condition de protéger et de
contribuer à faire
grandir
OpenStreetMap.
Ceci est un résumé expliquant simplement (et en aucun cas un substitut à) la licence ODbL (en
anglais).
OpenStreetMap® est disponible en données libres, sous licence de base de données ouverte Open
Data Commons
(ODbL)
(ODbL) par la Fondation OpenStreetMap (OSMF).
Vous êtes autorisé à :
-
<!-- noun-cc-share-573489-->
Partager : copier, distribuer et utiliser la base de données
-
<!-- noun-build-3136692-->
Créer : produire des cartes (ou nimporte quoi dautre !) à partir de la base de données
-
<!-- noun-layer-1159947-->
Adapter : modifier, transformer et construire avec la base de données
Et tout cela, pour un usage noun-artist-4516845 personnel tout autant que noun-dollar-1324742
commercial
Selon les conditions suivantes :
-
<!-- noun-contributions-4513764-->
Attribution : vous devez créditer OpenStreetMap pour tout usage public ou travail
dérivé de la base de données
-
<!-- noun-refresh-1815798-->
Partage sous les mêmes conditions : si vous faites un usage public de la base de données ou
dune version dérivée, les conditions de lODbL sappliquent
-
<!-- noun-open-padlock-5336638-->
Préserver louverture : si vous redistribuez la base de données ou une version dérivée
avec des mesures de protection (comme des DRM), vous devez alors également fournir une version
sans ces
mesures
de protection
</div>
<div class="tabs-box">
<div class="tabs-heading">
<!-- tabs:-->
<!-- noun-contributions-4513764-->
Créditer /
<!-- noun-together-3266241-->
Contributeurs /
<!-- noun-import-1243585-->
Imports interdits /
<!-- noun-thumb-5947085-->
Marque OpenStreetMap®
<!-- noun-contributions-4513764-->
</div>
<div class="tabs-body">
</div>
</div>
<div class="crediting-box">
<h2 id="crediting">
Créditer
</h2>
Lorsque vous utilisez des données dOpenStreetMap, vous devez effectuer les deux choses
suivantes :
Donnez crédit à OpenStreetMap en affichant notre avis des droits dauteur.
Indiquez clairement que les données sont disponibles sous la Licence Open Database.
<a href="https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines/fr">
→ Voir tous les usages
</a>
</div>
<!-- NB : au lieu de renvoyer vers une page externe, ça mériterait de développer un outil qui couvre la majorité des cas-->
<!-- dusage, du type Choose a License-->
<div class="contributors-box">
<h2 id="contributors">
<!-- noun-together-3266241 -->
Contributeurs
</h2>
Les données dOpenStreetMap sont créées par des milliers de personnes. Ces contributeurs peuvent
être
bénévoles
ou
professionnels.
Nous incluons également des données publiées sous licence ouverte par des agences nationales de
cartographie
et
dautres sources de données ouvertes.
<a href="https://wiki.openstreetmap.org/wiki/Contributors">
→ Voir tous les contributeurs
</a>
<!-- (en anglais ; sur le wiki dOpenStreetMap)-->
Linclusion de données dans OpenStreetMap nimplique pas que les fournisseurs dorigine du
contenu
approuvent
OpenStreetMap, ni quils garantissent ou acceptent quelque responsabilité que ce soit.
</div>
<div class="forbidden-imports-box">
<h2 id="forbidden_imports">
<!-- noun-import-1243585 -->
Imports interdits
</h2>
Nous rappelons aux contributeurs dOSM quils ne doivent jamais ajouter de données provenant de
sources
protégées
par le droit dauteur (copyright) ou des droits voisins (par ex. Google Maps ou des cartes
imprimées) sans
autorisation explicite de la part des détenteurs de ces droits.
Si vous pensez que des données protégées par des droits dauteur ont été ajoutées de manière
inappropriée à
la
base
de données OpenStreetMap :
<a href="https://wiki.osmfoundation.org/wiki/Takedown_procedure">
→ Procédure de retrait (en anglais)
</a>
<a href="https://dmca.openstreetmap.org/">
→ Page de signalement en ligne (en anglais)
</a>
</div>
<!-- noun-thumb-5947085 -->
<div class="brand-box">
<h2>
Marque OpenStreetMap®
</h2>
Les termes OpenStreetMap et State of the Map ainsi que le logo en forme de loupe sont des
marques déposées
de la
Fondation OpenStreetMap.
<a href="https://wiki.osmfoundation.org/wiki/Trademark_Policy">
→ Politique relative aux marques (en anglais)
</a>
</div>
<!-- noun-guideline-5892826-->
<div class="clarification-box">
<h2>
Clarifications dutilisation
</h2>
La fondation OpenStreetMap détaille ses directives pour les nombreuses possibilité spécifiques
dutilisation
des
données : création dune carte web ou imprimée, utilisation des données via une API, combinaison
avec des
bases
des données tierces …
<a href="https://wiki.osmfoundation.org/wiki/Licence/Community_Guidelines/fr">
→ Directives générales
</a>
</div>
<div class="contact-box">
<h2>
Contact
</h2>
Pour toute question relative à linterprétation de lODbL, veuillez consulter un avocat.
Vous pouvez contacter le legal working group, groupe de travail légal de la fondation.
<a href="legal-questions@osmfoundation.org">
→ legal-questions@osmfoundation.org
</a>
</div>
<!-- noun-warning-170417-->
<div class="warning-box">
<h2>
Avertissement
</h2>
Cette page nest pas une licence et na aucune valeur légale. Cest un résumé de <a
href="https://opendatacommons.org/licenses/odbl/1-0/">
lODbL 1.0
</a>; une explication
simplifiée du texte juridique complet. La licence ODbL nexiste quen anglais. Toute traduction
de lODbL ne
pourrait avoir une quelconque valeur légale. Veuillez vous référer à la licence
<a href="https://opendatacommons.org/licenses/odbl/1-0/">
ODbL 1.0
</a>: seuls ses termes
exacts
ont une valeur légale.
</div>
</article>
</div>
</div>
</div>
</div>
</body>
</html>

16
license-osm/readme.md Normal file
View File

@ -0,0 +1,16 @@
# page clarifiant la licence ODBL pour openstreetmap
# post sur le forum
https://forum.openstreetmap.fr/t/refonte-page-copyright/16792
overflorian
> Hello,
En anticipation de la finalisation de la traduction les community guidelines, on vous propose avec @tykayn de refondre la page https://www.openstreetmap.org/copyright sur linspiration de la très limpide page https://creativecommons.org/licenses/by-sa/4.0/deed.fr
Dans lidée, on en fait une version anglaise et une française et on les proposera à léquipe qui gère osm.org.
Commençons par la version française.
# ressources
choose a licence https://creativecommons.org/choose
Tous les logos utilisés sont ici : Nextcloud
https://nextcloud.junglebus.io/index.php/s/4g7Mmj8Wo4Cqypq

View File

@ -1,39 +1,5 @@
# Conversion de jeux de données geojson en tags OSM
# Mapping Geojson to OSM
installation
```bash
npm i
npm i -g geojsontoosm
this repo has moved to its own way:
```
## Tout convertir faire d'un coup
Pour récupérer le jeu de données pour les bornes elec et convertir le geojson en fichier osm, lancer le script bash
```bash
bash refresh_data.sh
```
Export depuis overpass turbo dans OSM
https://overpass-turbo.eu/s/1yhY
## config
Configurer le filtre de département et les autres options dans convert_to_osm_tags.ts.
## utilisation
```bash
node convert_to_osm_tags.ts
```
résultat en json dans le dossier output.
La sortie est filtrée selon le mappage donné et la zone de code postal de la config.
Réalisé pour l'intégration des bornes elec.
# Ressources
Tableau de conversion de l'open data
https://wiki.openstreetmap.org/wiki/France/data.gouv.fr/Bornes_de_Recharge_pour_V%C3%A9hicules_%C3%89lectriques
# Roadmap
## bornes recharge elec IRVE
* ne pas mettre ref:EU:EVSE si la valeur vaut "non concerné"
* convertir les False en no
* enlever les source:date
* enlever les name
https://forge.chapril.org/tykayn/mapping-geojson-osm

View File

@ -1,6 +0,0 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};

View File

@ -1,183 +0,0 @@
/**
build all files for departements from the dataset and the mapping engine
**/
const {exec} = require('child_process');
const execSync = require("child_process").execSync;
let min_department = 1;
const max_departement = 1
let enable_domtom = true;
// const max_departement = 95
function exec_command(command: string) {
console.log('=> command',
command
)
const result = execSync(command);
// convert and show the output.
console.log(result.toString("utf8"));
}
function build_department_geojson(department: string) {
let command = `ts-node convert_to_osm_tags.ts --department=${department}`;
console.log('command', command)
exec_command(command)
}
function convert_geojson_to_osm_for_department(department: string) {
let command = `geojsontoosm output/my_converted_data_set_filtered_zipcode_${department}.json > osm_output/bornes-irve-filetered-from-etalab-opendata_dep_${department}.osm`;
console.log('command', command)
exec_command(command)
}
for (let ii = min_department; ii <= max_departement; ii++) {
let departement = '' + ii
build_department_geojson(departement)
}
for (let ii = min_department; ii <= max_departement; ii++) {
let departement = '' + ii
convert_geojson_to_osm_for_department(departement)
}
// build_department_geojson('2A')
// convert_geojson_to_osm_for_department('2A')
// build_department_geojson('2B')
// convert_geojson_to_osm_for_department('2B')
if (enable_domtom) {
// départements corse et dom tom
let more_departements = ['2A', '2B'
, '971'
, '972'
, '973'
, '974'
, '975'
, '976']
more_departements.forEach((department => {
console.log(' mapping data for department ' + department)
let departement_string = '' + department
build_department_geojson(departement_string)
}))
more_departements.forEach((department => {
console.log('convert to osm ' + department)
let departement_string = '' + department
convert_geojson_to_osm_for_department(departement_string)
}))
}
/**
Numéro Départements Chef-lieu
01 Ain Bourg-en-Bresse
02 Aisne Laon
03 Allier Moulin
04 Alpes-de-Haute-Provence Digne
05 Hautes-Alpes Gap
06 Alpes-Maritimes Nice
07 Ardèche Privas
08 Ardennes Charleville-Mézières
09 Ariège Foix
10 Aube Troyes
11 Aude Carcassonne
12 Aveyron Rodez
13 Bouches-du-Rhône Marseille
14 Calvados Caen
15 Cantal Aurillac
16 Charente Angoulême
17 Charente-Maritime La Rochelle
18 Cher Bourges
19 Corrèze Tulle
21 Côte-d'Or Dijon
22 Côtes d'Armor Saint-Brieuc
23 Creuse Guéret
24 Dordogne Périgueux
25 Doubs Besançon
26 Drôme Valence
27 Eure Evreux
28 Eure-et-Loir Chartres
29 Finistère Quimper
30 Gard Nîmes
31 Haute-Garonne Toulouse
32 Gers Auch
33 Gironde Bordeaux
34 Hérault Montpellier
35 Ille-et-Vilaine Rennes
36 Indre Châteauroux
37 Indre-et-Loire Tours
38 Isère Grenoble
39 Jura Lons-le-Saunier
40 Landes Mont-de-Marsan
41 Loir-et-Cher Blois
42 Loire St-Étienne
43 Haute-Loire Le Puy
44 Loire-Atlantique Nantes
45 Loiret Orléans
46 Lot Cahors
47 Lot-et-Garonne Agen
48 Lozère Mende
49 Maine-et-Loire Angers
50 Manche St-
51 Marne Châlons-sur-Marne
52 Haute-Marne Chaumont
53 Mayenne Laval
54 Meurthe-et-Moselle Nancy
55 Meuse Bar-le-Duc
56 Morbihan Vannes
57 Moselle Metz
58 Nièvre Nevers
59 Nord Lille
60 Oise Beauvais
61 Orne Alençon
62 Pas-de-Calais Arras
63 Puy-de-Dôme Clermont-Ferrand
64 Pyrénées-Atlantiques Pau
65 Hautes-Pyrénées Tarbes
66 Pyrénées-Orientales Perpignan
67 Bas-Rhin Strasbourg
68 Haut-Rhin Colmar
69 Rhône Lyon
70 Haute-Saône Vesoul
71 Saône-et-Loire Mâcon
72 Sarthe Le Mans
73 Savoie Chambéry
74 Haute-Savoie Annecy
75 Paris Paris
76 Seine-Maritime Rouen
77 Seine-et-Marne Melun
78 Yvelines Versailles
79 Deux-Sèvres Niort
80 Somme Amiens
81 Tarn Albi
82 Tarn-et-Garonne Montauban
83 Var Toulon
84 Vaucluse Avignon
85 Vendée La Roche-sur-Yon
86 Vienne Poitiers
87 Haute-Vienne Limoges
88 Vosges Épinal
89 Yonne Auxerre
90 Territoire de Belfort Belfort
91 Essonne Evry
92 Hauts-de-Seine Nanterre
93 Seine-St-Denis Bobigny
94 Val-de-Marne Créteil
95 Val-D'Oise Pontoise
2A Corse-du-Sud Ajaccio
2B Haute-Corse Bastia
971 Guadeloupe Basse-Terre
972 Martinique Fort-de-France
973 Guyane Cayenne
974 La Réunion Saint-Denis
976 Mayotte Mamoudzou
**/

View File

@ -1,82 +0,0 @@
import fs from "fs";
let sourceFilePath: string = './chargemap_data/hurepoix.json'
/**
makes a geojson from chargemap layer data
*/
function convertChargemapFile(sourceFilePath: string) {
fs.readFile(sourceFilePath, 'utf8', function (err, data) {
let data_transformed: any = JSON.parse(data)
let base_dataset: any = {type: 'FeatureCollection', features: []}
let base_point: any = {
type: 'Feature',
geometry: {
type: 'Point',
coordinates: []
},
properties: {
amenity: "charging_station"
}
}
console.log('data_transformed.items.length', data_transformed.items.length)
data_transformed.items.forEach((item: any) => {
let new_point: any = {...base_point}
if (item.type == 'point') {
new_point.geometry.coordinates = [
item.properties?.lat,
item.properties?.lng,
]
} else if (item.type == 'pool') {
new_point.geometry.coordinates = [
item.pool.gps_coordinates.lon,
item.pool.gps_coordinates.lat,
]
console.log('new_point.geometry.coordinates', new_point.geometry.coordinates)
}
base_dataset.features.push(new_point)
})
console.log('base_dataset.features.length', base_dataset.features.length)
if (base_dataset) {
writeFile('hurepoix_geojson.json', JSON.stringify(base_dataset, null, 2))
}
})
}
/**
* crée un fichier dans le dossier par défaut, output
* @param fileName
* @param fileContent
*/
function writeFile(fileName: string, fileContent: any) {
let output_folder = 'output';
return fs.writeFile(
`./${output_folder}/${fileName}`,
fileContent,
'utf8',
(err) => {
if (err) {
console.log(`Error writing file: ${err}`)
} else {
console.log(`File ${fileName} is written successfully!`)
}
}
)
}
convertChargemapFile(sourceFilePath)

File diff suppressed because it is too large Load Diff

View File

@ -1,384 +0,0 @@
{
"count": 18,
"items": [
{
"lat": 50.0743484,
"lng": 1.537268,
"icon": "cluster.png",
"type": "cluster",
"count": 33
},
{
"lat": 49.6465569,
"lng": 0.595749,
"icon": "cluster.png",
"type": "cluster",
"count": 31
},
{
"lat": 49.9614983,
"lng": 1.1935092,
"icon": "cluster.png",
"type": "cluster",
"count": 26
},
{
"lat": 50.1074982,
"lng": 1.8426746,
"icon": "cluster.png",
"type": "cluster",
"count": 24
},
{
"lat": 50.2155533,
"lng": 1.628114,
"icon": "cluster.png",
"type": "cluster",
"count": 22
},
{
"lat": 49.6115227,
"lng": 0.7733023,
"icon": "cluster.png",
"type": "cluster",
"count": 21
},
{
"lat": 49.9128304,
"lng": 1.0857821,
"icon": "cluster.png",
"type": "cluster",
"count": 20
},
{
"lat": 49.8144035,
"lng": 0.657026,
"icon": "cluster.png",
"type": "cluster",
"count": 16
},
{
"lat": 49.8280449,
"lng": 0.911511,
"icon": "cluster.png",
"type": "cluster",
"count": 15
},
{
"lat": 49.5984917,
"lng": 1.1111569,
"icon": "cluster.png",
"type": "cluster",
"count": 14
},
{
"lat": 49.6525497,
"lng": 1.6158921,
"icon": "cluster.png",
"type": "cluster",
"count": 11
},
{
"lat": 49.7663574,
"lng": 1.7457,
"icon": "cluster.png",
"type": "cluster",
"count": 9
},
{
"lat": 49.9557304,
"lng": 1.767372,
"icon": "cluster.png",
"type": "cluster",
"count": 7
},
{
"lat": 49.8437424,
"lng": 1.7790869,
"icon": "cluster.png",
"type": "cluster",
"count": 3
},
{
"lat": 49.6544685,
"lng": 1.832823,
"icon": "cluster.png",
"type": "cluster",
"count": 2
},
{
"lat": 49.5701447,
"lng": 0.4898517,
"icon": "cluster.png",
"type": "cluster",
"count": 2
},
{
"lat": 49.5702896,
"lng": 1.609848,
"icon": "icon-accelerated_on.png",
"type": "pool",
"pool": {
"amenities": [],
"city": "Saumont-la-Poterie",
"real_time_available": true,
"rating": null,
"i18n_country_id": 67,
"emsps": [],
"gps_coordinates": {
"lon": 1.609848,
"lat": 49.5702896
},
"street_name": "358 Route de Paris ",
"speed": {
"icon": "accelerated.svg",
"self": "charging_speeds/3.json",
"id": 3,
"map_icon": "accelerated.png"
},
"should_check_prices": true,
"number": null,
"schedules": [],
"object_state_id": 2,
"is_indoor": false,
"id": 285402,
"slug": "eco-pi-saumont-la-poterie-358-route-de-paris",
"can_remote_start_charge": false,
"statistic": {
"global_note_average": null,
"price_note_average": null,
"location_note_average": null,
"security_note_average": null,
"comments_count": 0,
"reports_count": 0,
"checkins_count": 0,
"material_note_average": null,
"creation_date": "2023-07-29T02:04:10+00:00",
"ratings_count": 1
},
"can_update_charging_pool": false,
"is_always_open": true,
"can_charge_with_chargemap": true,
"location_type_id": 21,
"network_id": 2340,
"evse_emi3_ids": [
"FR*EPI*E11734505*1"
],
"charging_connectors": [
{
"count": 5,
"available_count": 3,
"evse_ids": [
701375,
701376,
701379,
701377,
701378
],
"type": "MENNEKES_TYPE_2",
"connector_type": {
"id": 14,
"icon": "type2"
},
"power_max": 22
}
],
"is_free": false,
"name": "Eco-PI - Saumont-la-Poterie - 358 Route de Paris ",
"location_type_slug": "unknown",
"charging_speed_id": 3,
"postal_code": "76440",
"country_code": "FR",
"is_tesla": false,
"evses": [
{
"id": 701375,
"is_available": true,
"realtime_state": "AVAILABLE"
},
{
"id": 701376,
"is_available": true,
"realtime_state": "AVAILABLE"
},
{
"id": 701379,
"is_available": true,
"realtime_state": "AVAILABLE"
},
{
"id": 701377,
"is_available": false,
"realtime_state": "OUT_OF_ORDER"
},
{
"id": 701378,
"is_available": false,
"realtime_state": "OUT_OF_ORDER"
}
]
}
},
{
"lat": 49.5693893,
"lng": 0.953997,
"icon": "icon-accelerated_on.png",
"type": "pool",
"pool": {
"amenities": [
"drinks",
"restoration",
"shop",
"restroom"
],
"city": "Pavilly",
"real_time_available": true,
"rating": 4,
"i18n_country_id": 67,
"emsps": [
10,
75,
77,
107,
108,
112
],
"gps_coordinates": {
"lon": 0.953997,
"lat": 49.5693893
},
"street_name": "Place du Président d'Esneval",
"speed": {
"icon": "accelerated.svg",
"self": "charging_speeds/3.json",
"id": 3,
"map_icon": "accelerated.png"
},
"should_check_prices": true,
"number": "4",
"schedules": [],
"object_state_id": 2,
"is_indoor": false,
"id": 105727,
"slug": "sde76-place-du-president-desneval-4-pavilly",
"can_remote_start_charge": false,
"statistic": {
"global_note_average": 4,
"price_note_average": 5,
"location_note_average": 2,
"security_note_average": 5,
"comments_count": 0,
"reports_count": 0,
"checkins_count": 25,
"material_note_average": 2,
"creation_date": "2023-07-29T02:01:25+00:00",
"ratings_count": 1
},
"can_update_charging_pool": false,
"is_always_open": true,
"can_charge_with_chargemap": true,
"location_type_id": 4,
"network_id": 404,
"evse_emi3_ids": [
"FR*S76*E100*1*1"
],
"charging_connectors": [
{
"count": 4,
"available_count": 2,
"evse_ids": [
25003,
25004,
390745,
390747
],
"type": "DOMESTIC_TYPE_F",
"connector_type": {
"id": 6,
"icon": "schuko"
},
"power_max": 3
},
{
"count": 7,
"available_count": 4,
"evse_ids": [
25003,
25004,
390745,
390747,
390662,
390663,
390664
],
"type": "MENNEKES_TYPE_2",
"connector_type": {
"id": 14,
"icon": "type2"
},
"power_max": 22
},
{
"count": 3,
"available_count": 2,
"evse_ids": [
390662,
390663,
390664
],
"type": "DOMESTIC_TYPE_F",
"connector_type": {
"id": 6,
"icon": "schuko"
},
"power_max": 2
}
],
"is_free": false,
"name": "SDE76 - Place du Président d'Esneval, 4 - Pavilly",
"location_type_slug": "parking",
"charging_speed_id": 3,
"postal_code": "76570",
"country_code": "FR",
"is_tesla": false,
"evses": [
{
"id": 25003,
"is_available": true,
"realtime_state": "AVAILABLE"
},
{
"id": 25004,
"is_available": true,
"realtime_state": "AVAILABLE"
},
{
"id": 390745,
"is_available": false,
"realtime_state": "OUT_OF_ORDER"
},
{
"id": 390747,
"is_available": false,
"realtime_state": "OUT_OF_ORDER"
},
{
"id": 390662,
"is_available": false,
"realtime_state": "OUT_OF_ORDER"
},
{
"id": 390663,
"is_available": true,
"realtime_state": "AVAILABLE"
},
{
"id": 390664,
"is_available": true,
"realtime_state": "AVAILABLE"
}
]
}
}
]
}

View File

@ -1,299 +0,0 @@
/**
* convertisseur de données de bornes de recharge électrique à partir de données Chargemap et open data Etalab
*/
import * as fs from 'fs'
import mappingConfigIRVE from './mappings/converters/configIRVE'
import mappingConfigIRVE_simple from './mappings/converters/mappingConfigIRVE_simple'
import mapping_engine from './mappings/engine'
import {BoundingBoxCoordinatesType, FeatureCollection} from "./mappings/mapping-config.type";
import utils from './mappings/utils'
const minimist = require('minimist')
const debugLog = utils.debugLog;
let use_mapping_engine = false
use_mapping_engine = true
let Mapping_engine = new mapping_engine(mappingConfigIRVE)
let mini_arguments: any = minimist(process.argv.slice(2))
// let sourceFilePathGeoJson = './etalab_data/small.json'
let sourceFilePathGeoJson = './etalab_data/all.json'
// let sourceFilePathGeoJson = './output/my_converted_data_set_filtered_zipcode_91.json'
// let sourceFilePathGeoJson = './output/my_converted_data_set_filtered_zipcode_91_small.json'
// wip filter
let filterOnBoundingBox = true
filterOnBoundingBox = false
let boundingBoxCoordinates: BoundingBoxCoordinatesType = {
xMin: 1.91,
xMax: 2.38,
yMin: 48.7,
yMax: 48.4,
}
let filterCoordinates = true
filterCoordinates = false
let enable_filter_on_department = true
enable_filter_on_department = false
let filterDepartment = 91
if (mini_arguments['department']) {
filterDepartment = mini_arguments['department']
enable_filter_on_department = true
}
if (mini_arguments['source']) {
sourceFilePathGeoJson = mini_arguments['source']
}
if (mini_arguments['engine']) {
use_mapping_engine = mini_arguments['engine']
}
let filterZipCode = new RegExp(`^${filterDepartment}`)
let filterZipCodeAdresse = new RegExp(` ${filterDepartment}`)
let filteredName = ''
if (enable_filter_on_department) {
filteredName = '_filtered_zipcode_' + filterDepartment
} else if (filterOnBoundingBox) {
filteredName = '_filtered_bbox_' + boundingBoxCoordinates.xMin + '-' + boundingBoxCoordinates.xMax + '_' + boundingBoxCoordinates.yMin + '-' + boundingBoxCoordinates.yMax
}
let pointCounterMax: number = 1000000
let limitConversionToFirstPoint: boolean = false
// limitConversionToFirstPoint = true
if (limitConversionToFirstPoint) {
pointCounterMax = 1
}
let defaultPropertiesOfPoint: any = {
'amenity': 'charging_station'
}
let converted_geo_json: any = {
type: 'FeatureCollection',
features: []
}
let output_folder = 'output';
/**
* crée un fichier dans le dossier par défaut, output
* @param fileName
* @param fileContent
*/
function writeFile(fileName: string, fileContent: any) {
debugLog('write file ', fileName)
return fs.writeFile(
`./${output_folder}/${fileName}`,
fileContent,
'utf8',
(err) => {
if (err) {
debugLog(`Error writing file: ${err}`)
} else {
debugLog(`File ${fileName} is written successfully!`)
}
}
)
}
/**
*
* @param sourceFilePath
* @param mapping
* @param pointCounterMax
* @param boundingBoxCoordinates
*/
function convertDataForIRVE(sourceFilePath: string, mapping: any, pointCounterMax: number, boundingBoxCoordinates: any) {
debugLog('convertDataForIRVE from ', sourceFilePath)
fs.readFile(sourceFilePath, 'utf8', function (err, data) {
let point_counter = 0
let feature_points_after_filter: any = []
if (err) {
return debugLog(err)
}
let data_transformed: FeatureCollection = JSON.parse(data)
// debug('data keys ', Object.keys(dataTransformed))
// debugLog('properties of point 0', data_transformed.features[0])
if (data_transformed.features) {
debugLog('data found, features:', data_transformed.features.length)
// find interesting list of points to use
let list_of_points: any = data_transformed.features
debugLog('listOfPoints.length', list_of_points.length)
/**
* filtering
* TODO: do it in the engine
*/
// for each point from the data source, filter if we take it or not
list_of_points.forEach((feature_point: any) => {
let regex_filter_test_result = true
if (enable_filter_on_department) {
debugLog('filtre sur les départements activé')
regex_filter_test_result = (
filterZipCode.test(feature_point.properties.consolidated_code_postal)
||
filterZipCodeAdresse.test(feature_point.properties.adresse_station)
)
} else {
debugLog('pas de filtre sur les départements')
}
if (filterOnBoundingBox) {
debugLog('filtre sur les coordonnées bounding box activé')
let x = feature_point.properties.coordonneesXY[0]
let xMin = boundingBoxCoordinates.xMin
let xMax = boundingBoxCoordinates.xMax
let yMin = boundingBoxCoordinates.yMin
let yMax = boundingBoxCoordinates.yMax
let y = feature_point.properties.coordonneesXY[1]
regex_filter_test_result = (
(x >= xMin && x <= xMax)
&&
(y >= yMin && y <= yMax)
)
} else {
debugLog('pas de filtre sur les coordonnées bounding box')
}
// TODO add filter offset max
// filter points depending on zipcode
if (regex_filter_test_result) {
feature_points_after_filter.push(feature_point)
debugLog(' +1 point', point_counter)
point_counter++
}
})
/**
* conversion
*/
debugLog(' after filtering, feature_points_after_filter number of points: ', feature_points_after_filter.length)
feature_points_after_filter.forEach((feature_point: any) => {
// debugLog('featurePoint.properties.consolidated_code_postal', feature_point.properties.consolidated_code_postal)
debugLog('convert : work on 1 point')
// debugLog('convert :featurePoint', feature_point)
let mapped_point: any = {}
if (use_mapping_engine) {
// debugLog('convert :using mapping engine on feature point'
// , feature_point
// )
mapped_point = Mapping_engine.mapElementFromConf(feature_point)
debugLog('mapped_point', mapped_point)
} else {
debugLog('convert :using simple converter on feature point', feature_point)
mapped_point = mapElementFromConfSimple(feature_point, mapping)
}
// debugLog('mapped_point one point', mapped_point)
if (mapped_point) {
converted_geo_json.features.push(mapped_point)
debugLog('convert : added one point to converted_geo_json')
} else {
debugLog('convert : !!! there is no map one point')
}
})
// output new geojson
debugLog('convert : convertedGeoJson.features.length', converted_geo_json.features.length)
// write file on disk
if (converted_geo_json.features.length) {
let fileNameToWrite = 'my_converted_data_set' + filteredName + '.json'
console.log('features: ', converted_geo_json.features.length)
debugLog('convert : write file ', fileNameToWrite)
writeFile(fileNameToWrite, JSON.stringify(converted_geo_json, null, 2))
} else {
console.log('convert : no writing of file, because there is no converted feature')
}
// console.log('convert : converted_geo_json output:', converted_geo_json.features)
return converted_geo_json
}
})
}
/**
* retuns the converted element from mapping config if present, null otherwise
*/
function mapElementFromConfSimple(featurePoint: any, mappingConfig: any) {
let mappingKeys = Object.keys(mappingConfig)
let featurePointPropertiesKeys = Object.keys(featurePoint.properties)
debugLog('keys', mappingKeys, featurePointPropertiesKeys)
let newProperties: any = defaultPropertiesOfPoint
// reinit properties of current point
let basePoint = Object.create(featurePoint)
basePoint.type = featurePoint.type
basePoint.geometry = featurePoint.geometry
basePoint.properties = newProperties
// apply new properties if found in mapping config
featurePointPropertiesKeys.forEach((pointKeyName: string) => {
if (mappingKeys.indexOf(pointKeyName) !== -1) {
// debugLog('found element', pointKeyName, '=>', mappingConfig[pointKeyName], 'value : ', featurePoint.properties[pointKeyName])
let convertedValue: any = ''
if (utils.isBooleanKey(pointKeyName)) {
let copyOfValue: any = '' + featurePoint.properties[pointKeyName]
if (typeof copyOfValue === typeof Object && copyOfValue.key_converted) {
copyOfValue = copyOfValue.key_converted
}
convertedValue = copyOfValue.toLowerCase() == 'true' ? 'yes' : 'no'
} else {
convertedValue = featurePoint.properties[pointKeyName]
}
if (convertedValue) {
let convertedKey: any = mappingConfig[pointKeyName]
newProperties[convertedKey] = convertedValue
}
}
})
debugLog('basePoint', basePoint)
return basePoint
}
if (use_mapping_engine) {
debugLog(' - using mapping engine')
debugLog(' - pointCounterMax', pointCounterMax)
Mapping_engine.setConfig(mappingConfigIRVE)
convertDataForIRVE(sourceFilePathGeoJson, mappingConfigIRVE, pointCounterMax, boundingBoxCoordinates)
} else {
let mappingConfigIRVE = mappingConfigIRVE_simple
convertDataForIRVE(sourceFilePathGeoJson, mappingConfigIRVE, pointCounterMax, boundingBoxCoordinates)
}

View File

@ -1,260 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1691227045577" clover="3.2.0">
<project timestamp="1691227045577" name="All files">
<metrics statements="239" coveredstatements="113" conditionals="6" coveredconditionals="4" methods="9" coveredmethods="4" elements="254" coveredelements="121" complexity="0" loc="239" ncloc="239" packages="2" files="3" classes="3"/>
<package name="data_other.testing">
<metrics statements="34" coveredstatements="34" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
<file name="mappings_to_test.ts" path="/home/poule/encrypted/stockage-syncable/www/development/html/scripts/mapping_geojson_to_osm_tags/data_other/testing/mappings_to_test.ts">
<metrics statements="34" coveredstatements="34" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
<line num="1" count="1" type="stmt"/>
<line num="2" count="1" type="stmt"/>
<line num="3" count="1" type="stmt"/>
<line num="4" count="1" type="stmt"/>
<line num="5" count="1" type="stmt"/>
<line num="6" count="1" type="stmt"/>
<line num="7" count="1" type="stmt"/>
<line num="8" count="1" type="stmt"/>
<line num="9" count="1" type="stmt"/>
<line num="10" count="1" type="stmt"/>