Skip to content
Snippets Groups Projects
Commit a4ae4953 authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Replaced requests.get by s.get, in order to make use of HTTP(S) proxies

parent 1fd39b4f
Branches
No related tags found
No related merge requests found
Pipeline #4366 failed
%% Cell type:markdown id: tags:
# 1 - Collecte des données
%% Cell type:markdown id: tags:
Nous allons avoir besoin des modules suivants :
%% Cell type:code id: tags:
``` python
import requests
import json
```
%% Cell type:markdown id: tags:
...et des proxies HTTP(S) qui vont bien :
%% Cell type:code id: tags:
``` python
proxies = {
'http': 'http://proxyhttp1pro:8080',
'https': 'http://proxyhttp1pro:8080'
}
s = requests.Session()
```
%% Cell type:code id: tags:
``` python
s.proxies = proxies
```
%% Cell type:markdown id: tags:
## Préambule
%% Cell type:markdown id: tags:
Nous souhaitons collecter les données relatives au jeu de données présenté ici : https://data.beta.grandlyon.com/fr/datasets/arbres-alignement-metropole-lyon/info. Le portail data.grandlyon.com peut nous fournir un exemple de requête WFS permettant de récupérer 30 enregistrements dans le format GeoJSON. Voici cette URL:
%% Cell type:code id: tags:
``` python
url = "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=30"
```
%% Cell type:markdown id: tags:
La commande suivante permet d'effectuer une requête HTTP vers cette URL, et de stocker le résultat dans la variable `res` :
%% Cell type:code id: tags:
``` python
res = s.get(url)
```
%% Cell type:markdown id: tags:
On peut consulter le "status code" de la requête comme suit :
%% Cell type:code id: tags:
``` python
res.status_code
```
%% Output
200
%% Cell type:markdown id: tags:
Si le status code est égal à 200, alors c'est bon : la requête a réussi !
%% Cell type:markdown id: tags:
La commande suivante permet de stocker la réponse de la requête dans la variable `data`, au format JSON :
%% Cell type:code id: tags:
``` python
data = res.json()
```
%% Cell type:markdown id: tags:
Afin de visualiser son contenu, vous pouvez décommenter la ligne suivante et l'exécuter :
%% Cell type:code id: tags:
``` python
#data
```
%% Cell type:code id: tags:
``` python
data.keys()
```
%% Output
dict_keys(['features', 'type', 'name', 'crs'])
%% Cell type:markdown id: tags:
Les données qui nous intéressent se trouvent dans la clé `features` du dictionnaire `data` :
%% Cell type:code id: tags:
``` python
records = data['features']
```
%% Cell type:markdown id: tags:
Comme "promis", nous avons collecté 30 enregistrements :
%% Cell type:code id: tags:
``` python
len(data['features'])
```
%% Output
30
%% Cell type:markdown id: tags:
## Collecte "paginée" des données
%% Cell type:markdown id: tags:
On introduit une fonction qui permet de construire les URLs relatives aux différentes pages que nous devons consulter :
%% Cell type:code id: tags:
``` python
def build_url(maxfeatures_per_page, page_no):
if page_no < 1:
raise Exception('page_no has to be greater than 1!')
startindex = maxfeatures_per_page * (page_no-1)
root_url = "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326"
url = root_url + "&maxfeatures=%i&startindex=%i" % (maxfeatures_per_page, startindex)
return url
```
%% Cell type:markdown id: tags:
URL pour la première page de 100 éléments :
%% Cell type:code id: tags:
``` python
build_url(100, 2)
```
%% Output
'https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=100&startindex=100'
%% Cell type:markdown id: tags:
URL pour la déuxième page de 1000 éléments :
%% Cell type:code id: tags:
``` python
build_url(1000, 2)
```
%% Output
'https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=1000'
%% Cell type:markdown id: tags:
La commande `range(a, b)` permet de générer la liste de numéros entiers allant de `a` à `b`:
%% Cell type:code id: tags:
``` python
list(range(1, 10))
```
%% Output
[1, 2, 3, 4, 5, 6, 7, 8, 9]
%% Cell type:markdown id: tags:
Le jeu de donnée en question incluant un peu plus que 94000 enregistrements, on aura besoin de pas plus que 95 pages de 1000 éléments :
%% Cell type:code id: tags:
``` python
le_nombre_de_enregistrements_par_page = 1000
# on utilisera la variable suivante pour comuler les réponses des différentes requêtes :
records = []
for i in range(1, 96):
url = build_url(le_nombre_de_enregistrements_par_page, i)
print(i, url)
res = requests.get(url)
res = s.get(url)
data = res.json()
records += data['features']
if len(data['features']) < le_nombre_de_enregistrements_par_page:
# cela veut dire que nous avons atteint la dernière page !
break
```
%% Output
1 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=0
2 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=1000
3 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=2000
4 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=3000
5 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=4000
6 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=5000
7 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=6000
8 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=7000
9 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=8000
10 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=9000
11 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=10000
12 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=11000
13 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=12000
14 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=13000
15 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=14000
16 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=15000
17 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=16000
18 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=17000
19 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=18000
20 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=19000
21 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=20000
22 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=21000
23 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=22000
24 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=23000
25 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=24000
26 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=25000
27 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=26000
28 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=27000
29 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=28000
30 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=29000
31 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=30000
32 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=31000
33 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=32000
34 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=33000
35 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=34000
36 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=35000
37 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=36000
38 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=37000
39 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=38000
40 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=39000
41 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=40000
42 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=41000
43 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=42000
44 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=43000
45 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=44000
46 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=45000
47 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=46000
48 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=47000
49 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=48000
50 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=49000
51 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=50000
52 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=51000
53 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=52000
54 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=53000
55 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=54000
56 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=55000
57 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=56000
58 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=57000
59 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=58000
60 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=59000
61 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=60000
62 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=61000
63 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=62000
64 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=63000
65 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=64000
66 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=65000
67 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=66000
68 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=67000
69 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=68000
70 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=69000
71 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=70000
72 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=71000
73 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=72000
74 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=73000
75 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=74000
76 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=75000
77 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=76000
78 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=77000
79 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=78000
80 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=79000
81 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=80000
82 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=81000
83 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=82000
84 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=83000
85 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=84000
86 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=85000
87 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=86000
88 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=87000
89 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=88000
90 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=89000
91 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=90000
92 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=91000
93 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=92000
94 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=93000
95 https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputFormat=application/json; subtype=geojson&request=GetFeature&typename=abr_arbres_alignement.abrarbre&SRSNAME=EPSG:4326&maxfeatures=1000&startindex=94000
%% Cell type:markdown id: tags:
La commande suivante nous permet de stocker les données dans un fichier le résultat des requêtes précedentes :
%% Cell type:code id: tags:
``` python
filename = 'data/arbres_alignement_Lyon.json'
with open(filename, 'w') as fp:
json.dump(records, fp)
```
%% Cell type:markdown id: tags:
On utilisera ce fichier comme entrée des cahiers suivants...
%% Cell type:code id: tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment