Repo for non destructive e-scooter intervention materials
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
789 B

4 years ago
import folium
import requests
import json
4 years ago
import subprocess
4 years ago
4 years ago
#make api request
out1 = subprocess.Popen(["curl", "https://platform.tier-services.io/v1/vehicle/f6f55778-9339-4f81-8584-7645f3a6c4be", "-H", "x-api-key: bpEUTJEBTf74oGRWxaIcW7aeZMzDDODe1yBoSxi2"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, stderr = out1.communicate()
request_scooter1 = stdout
4 years ago
4 years ago
#import scooter data
4 years ago
lat = request_scooter1['data']['attributes']['lat']
lng = request_scooter1['data']['attributes']['lng']
4 years ago
#create map object
4 years ago
m = folium.Map(location=[52.516190, 13.377693], zoom_start=13)
4 years ago
#create markers
folium.Marker([lat,lng],
4 years ago
popup='<strong>ARTIST_NAME + ARTWORK_TITLE<strong/>',
tooltip='ARTIST_NAME_HERE',
4 years ago
icon=folium.Icon(icon='cloud')).add_to(m)
#generate map.html
m.save('map.html')