Spaces:
Sleeping
Sleeping
switch to OAuth auth. method
Browse files
app.py
CHANGED
@@ -19,7 +19,6 @@ def get_nearest_image(lat, lon, radius=50):
|
|
19 |
Get the nearest Mapillary image to given coordinates
|
20 |
"""
|
21 |
params = {
|
22 |
-
'access_token': MAPILLARY_ACCESS_TOKEN,
|
23 |
'fields': 'id,thumb_1024_url',
|
24 |
'limit': 1
|
25 |
}
|
@@ -31,11 +30,13 @@ def get_nearest_image(lat, lon, radius=50):
|
|
31 |
}}
|
32 |
"""
|
33 |
|
|
|
34 |
try:
|
35 |
response = requests.post(
|
36 |
"https://graph.mapillary.com/images/search",
|
37 |
json=query,
|
38 |
-
params=params
|
|
|
39 |
)
|
40 |
response.raise_for_status()
|
41 |
data = response.json()
|
|
|
19 |
Get the nearest Mapillary image to given coordinates
|
20 |
"""
|
21 |
params = {
|
|
|
22 |
'fields': 'id,thumb_1024_url',
|
23 |
'limit': 1
|
24 |
}
|
|
|
30 |
}}
|
31 |
"""
|
32 |
|
33 |
+
header = {'Authorization' : 'OAuth {}'.format(MAPILLARY_ACCESS_TOKEN)}
|
34 |
try:
|
35 |
response = requests.post(
|
36 |
"https://graph.mapillary.com/images/search",
|
37 |
json=query,
|
38 |
+
params=params,
|
39 |
+
headers=header
|
40 |
)
|
41 |
response.raise_for_status()
|
42 |
data = response.json()
|