récup des routes à maxspeed par osm
This commit is contained in:
parent
c91394fffd
commit
7bb3ca841e
@ -0,0 +1 @@
|
||||
{"type": "FeatureCollection", "features": []}
|
15
routes-limites-vitesse/2024-07-09_routes_maxspeed.json
Normal file
15
routes-limites-vitesse/2024-07-09_routes_maxspeed.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"version": 0.6,
|
||||
"generator": "Overpass API 0.7.62.1 084b4234",
|
||||
"osm3s": {
|
||||
"timestamp_osm_base": "2024-07-09T15:04:45Z",
|
||||
"timestamp_areas_base": "2024-07-09T10:18:02Z",
|
||||
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
|
||||
},
|
||||
"elements": [
|
||||
|
||||
|
||||
|
||||
],
|
||||
"remark": "runtime error: Query timed out in \"area-query\" at line 3 after 201 seconds."
|
||||
}
|
27
routes-limites-vitesse/get_whole_france.sh
Normal file
27
routes-limites-vitesse/get_whole_france.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Définir la requête Overpass
|
||||
OVERPASS_QUERY='[out:json][timeout:200];
|
||||
area["ISO3166-1"="FR"]["admin_level"="2"];
|
||||
nwr(area)["maxspeed"];
|
||||
out geom;
|
||||
area(-60.0,-20.0,10.0,52.0)["ISO3166-1"="FR"]["admin_level"="4"];
|
||||
nwr(area)["maxspeed"];
|
||||
out geom;'
|
||||
|
||||
# Définir le nom du fichier de sortie
|
||||
OUTPUT_FILE="routes_maxspeed.json"
|
||||
OUTPUT_FILE_GEOJSON="routes_maxspeed.geojson"
|
||||
|
||||
# Exécuter la requête Overpass avec Overpass Turbo
|
||||
curl -H 'Accept-Encoding: identity' 'https://overpass-api.de/api/interpreter' -X POST -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0' -H 'Accept: */*' -H 'Accept-Language: fr,en-US;q=0.7,en;q=0.3' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Origin: https://overpass-turbo.eu' -H 'Connection: keep-alive' -H 'Referer: https://overpass-turbo.eu/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'Sec-GPC: 1' -H 'Priority: u=1' --data-raw "data=${OVERPASS_QUERY}" -o "$OUTPUT_FILE"
|
||||
|
||||
# Vérifier si la requête a réussi
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Export réussi! Le fichier $OUTPUT_FILE a été créé."
|
||||
else
|
||||
echo "Erreur lors de l'export : $?"
|
||||
fi
|
||||
|
||||
osm2geojson $OUTPUT_FILE $OUTPUT_FILE_GEOJSON -f
|
||||
date2name $OUTPUT_FILE $OUTPUT_FILE_GEOJSON
|
14
routes-limites-vitesse/readme.md
Normal file
14
routes-limites-vitesse/readme.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Base ouverte des routes ayant une limite de vitesse renseignée
|
||||
|
||||
Cet extrait d'OSM au format geojson se récupère en exécutant le script principal puis en convertissant son résultat en geojson avec un paquet python-pip.
|
||||
|
||||
On peut aussi convertir le geojson au format OSM pour l'ouvrir dans JOSM et garder ses tags.
|
||||
|
||||
https://wiki.openstreetmap.org/wiki/FR:Key:maxspeed
|
||||
|
||||
## Prérequis
|
||||
|
||||
- curl
|
||||
- python-pip
|
||||
- osm2geojson
|
||||
- date2name
|
Loading…
Reference in New Issue
Block a user