mirror of
https://forge.chapril.org/tykayn/wololo
synced 2025-06-20 01:34:42 +02:00
réinit
This commit is contained in:
commit
996524bc6d
107 changed files with 1295536 additions and 0 deletions
13
mappings/extractors/askangela.sh
Normal file
13
mappings/extractors/askangela.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points
|
||||
# "harassment_prevention=ask_angela"
|
||||
# pour le monde entier
|
||||
|
||||
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:25];nwr["harassment_prevention"="ask_angela"];out+meta;'
|
||||
|
||||
export_file="ask_angela_points_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
11
mappings/extractors/cargo_bike_france.sh
Normal file
11
mappings/extractors/cargo_bike_france.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des parking à vélo cargo
|
||||
# cargo_bike=*
|
||||
# en France
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["cargo_bike"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="cargo_bike_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
13
mappings/extractors/centrales_france.sh
Normal file
13
mappings/extractors/centrales_france.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points
|
||||
# tout système produisant de l'énergie, pas seulement élec.
|
||||
# pour le monde entier
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;node["power"="generator"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="centrales_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
11
mappings/extractors/coworking_france.sh
Normal file
11
mappings/extractors/coworking_france.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points
|
||||
# des espaces de coworking
|
||||
# en France
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;node["amenity"="coworking_space"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="coworking_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
60
mappings/extractors/geojson_to_csv.py
Normal file
60
mappings/extractors/geojson_to_csv.py
Normal file
|
@ -0,0 +1,60 @@
|
|||
import argparse
|
||||
import json
|
||||
import pandas as pd
|
||||
|
||||
# définir le parseur d'arguments
|
||||
parser = argparse.ArgumentParser(description="Convertir un fichier GeoJSON en CSV et ajouter des colonnes latitude et longitude")
|
||||
parser.add_argument("geojson", help="Le chemin du fichier GeoJSON à convertir")
|
||||
parser.add_argument("-o", "--output", default=None, help="Le nom du fichier de sortie CSV (par défaut: le même nom que le fichier GeoJSON avec l'extension CSV)")
|
||||
args = parser.parse_args()
|
||||
|
||||
# charger le fichier GeoJSON en tant que liste de features
|
||||
with open(args.geojson, "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
# afficher le décompte des éléments
|
||||
print("Nombre d'éléments dans le fichier GeoJSON :", len(data["features"]))
|
||||
|
||||
# initialiser un ensemble pour stocker les clés de toutes les features
|
||||
all_keys = set()
|
||||
|
||||
# parcourir chaque feature pour trouver les clés de tag
|
||||
for feature in data["features"]:
|
||||
# ajouter les clés de la feature à l'ensemble
|
||||
all_keys.update(feature["properties"]["tags"].keys())
|
||||
|
||||
# convertir l'ensemble en liste et trier les clés
|
||||
columns = sorted(list(all_keys))
|
||||
|
||||
# initialiser le dataframe avec les colonnes définies ci-dessus
|
||||
df = pd.DataFrame(columns=["id", "latitude", "longitude"] + columns)
|
||||
|
||||
# parcourir chaque feature pour ajouter une nouvelle ligne au dataframe avec les valeurs de chaque tag
|
||||
for feature in data["features"]:
|
||||
# définir la latitude et la longitude selon la première coordonnée si la géométrie est de type Linestring
|
||||
if feature["geometry"]["type"] == "LineString":
|
||||
latitude = feature["geometry"]["coordinates"][0][1]
|
||||
longitude = feature["geometry"]["coordinates"][0][0]
|
||||
else:
|
||||
latitude = feature["geometry"]["coordinates"][1]
|
||||
longitude = feature["geometry"]["coordinates"][0]
|
||||
|
||||
row = {
|
||||
"id": feature["properties"]["id"],
|
||||
"latitude": latitude,
|
||||
"longitude": longitude
|
||||
}
|
||||
# ajouter les valeurs de chaque tag à la ligne
|
||||
for key in columns:
|
||||
row[key] = feature["properties"]["tags"].get(key, "")
|
||||
df = df._append(row, ignore_index=True)
|
||||
|
||||
# définir le nom du fichier de sortie CSV
|
||||
if args.output:
|
||||
output_file = args.output
|
||||
else:
|
||||
output_file = os.path.splitext(args.geojson)[0] + ".csv"
|
||||
|
||||
print('fichier csv converti : ', output_file)
|
||||
# convertir le dataframe en CSV en incluant toutes les colonnes
|
||||
df.to_csv(output_file, sep=";", index=False)
|
13
mappings/extractors/hackerspace_france.sh
Normal file
13
mappings/extractors/hackerspace_france.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points
|
||||
# leisure=hackerspace
|
||||
# en France
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["leisure"="hackerspace"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="hackerspace_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
10
mappings/extractors/hospitals_france.sh
Normal file
10
mappings/extractors/hospitals_france.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des hopitaux
|
||||
# en France
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="hospital"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="hospitals_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
11
mappings/extractors/irve_france.sh
Normal file
11
mappings/extractors/irve_france.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des stations et bornes de recharges
|
||||
# "amenity"="charging_station"
|
||||
# en France
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="charging_station"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="irve_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
13
mappings/extractors/irve_rouen.sh
Normal file
13
mappings/extractors/irve_rouen.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points d'apport volontaire
|
||||
# amenity=recycling
|
||||
# à Rouen
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3600075628)->.searchArea;nwr["amenity"="charging_station"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="irve_zone_rouen_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
10
mappings/extractors/mairies.sh
Normal file
10
mappings/extractors/mairies.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des mairies
|
||||
# en France
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="townhall"](area.searchArea);out+meta;'
|
||||
|
||||
export_file="mairies_points_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
12
mappings/extractors/museums_france.sh
Normal file
12
mappings/extractors/museums_france.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des musées en France
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;node["tourism"="museum"](area.searchArea);out+geom;'
|
||||
|
||||
|
||||
export_file="museum_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
13
mappings/extractors/pav_france.sh
Normal file
13
mappings/extractors/pav_france.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points d'apport volontaire
|
||||
# amenity=recycling
|
||||
# en France
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="recycling"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="pav_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
13
mappings/extractors/pav_rouen.sh
Normal file
13
mappings/extractors/pav_rouen.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points d'apport volontaire
|
||||
# amenity=recycling
|
||||
# à Rouen
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3600075628)->.searchArea;nwr["amenity"="recycling"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="pav_zone_rouen_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
14
mappings/extractors/planning_familiaux.sh
Normal file
14
mappings/extractors/planning_familiaux.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points de planning familial du monde entier
|
||||
# pour le monde entier
|
||||
|
||||
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:25];nwr["healthcare:speciality"="family_planning"];out+meta;'
|
||||
|
||||
export_file="planning_familial_points_from_openstreetmap"
|
||||
|
||||
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
12
mappings/extractors/ponts.sh
Normal file
12
mappings/extractors/ponts.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des ponts qui ont un nom
|
||||
# pour le monde entier
|
||||
|
||||
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["bridge"]["name"](area.searchArea);out+meta;'
|
||||
|
||||
export_file="ponts_points_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
12
mappings/extractors/restaurant_france.sh
Normal file
12
mappings/extractors/restaurant_france.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des restaurants
|
||||
# "amenity"="restaurant" en France
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="restaurant"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="restaurant_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
12
mappings/extractors/surveillance_france.sh
Normal file
12
mappings/extractors/surveillance_france.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des caméras de surveillance
|
||||
# "man_made"="surveillance"
|
||||
# en France
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=%5Bout%3Ajson%5D%5Btimeout%3A300%5D%3B%0Aarea(id%3A3602202162)-%3E.searchArea%3B%0Anode%5B%22man_made%22%3D%22surveillance%22%5D(area.searchArea)%3B%0Aout+geom%3B'
|
||||
|
||||
export_file="surveillance_zone_france_from_openstreetmap"
|
||||
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
13
mappings/extractors/toilets_france.sh
Normal file
13
mappings/extractors/toilets_france.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export depuis OSM des points
|
||||
# "amenity"="toilets"
|
||||
# en France
|
||||
|
||||
echo -e "\n récupération de données depuis OpenStreetMap \n"
|
||||
|
||||
url='https://overpass-api.de/api/interpreter?data=[out:json][timeout:300];area(id:3602202162)->.searchArea;nwr["amenity"="toilets"](area.searchArea);out+geom;'
|
||||
|
||||
export_file="toilets_zone_france_from_openstreetmap"
|
||||
source $www_folder/mapping-osm-geojson/update_scripts/functions.sh
|
||||
extract_from_osm $url $export_file
|
Loading…
Add table
Add a link
Reference in a new issue