-
Notifications
You must be signed in to change notification settings - Fork 0
/
OSM_query.py
60 lines (34 loc) · 958 Bytes
/
OSM_query.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python
# coding: utf-8
# In[28]:
import requests
import json
headers = {'Accept': '*/*', 'Origin': 'http://overpass-turbo.eu', 'Referer': 'http://overpass-turbo.eu/'}
overpass_url = "https://overpass.kumi.systems/api/interpreter"
query = """
[out:json];
area["ISO3166-1"="RU"][admin_level=2];
(node["leisure"="fitness_centre"](area);
node["leisure"="fitness_station"](area);
node["leisure"="sports_centre"](area);
node["leisure"="swimming_pool"](area);
node["shop"="health_food"](area);
node["shop"]["organic"](area);
node["shop"="bicycle"](area);
node["shop"="ski"](area);
node["shop"="sports"](area);
node["shop"="jetski"](area);
node["shop"="outdoor"](area);
node["shop"="scuba_diving"](area);
node["sport"](area);
);
out center;
"""
response = requests.get(overpass_url,
params={'data': query})
data = response.json()
# In[31]:
print(len(data['elements']))
# In[ ]:
print(data)
# In[27]: