Created
February 25, 2018 08:12
-
-
Save tim-fan/736bbaf79dfd5235111619612fde3a1c to your computer and use it in GitHub Desktop.
Plot Onzo bike locations on google maps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#script to plot onzo bike locations on google maps. | |
#After running, open onzoMap.html to view map. | |
#ToDo: Add overlay of bike info: charge level, times used, id, etc. | |
import pandas as pd | |
import gmplot | |
import requests | |
apiUrl = 'https://app.onzo.co.nz/nearby/-36.848123/174.765588/50.0' | |
response = requests.get(apiUrl) | |
data = pd.DataFrame(response.json()['data']) | |
gmap = gmplot.GoogleMapPlotter.from_geocode("Auckland") | |
gmap.scatter(data.latitude, data.longitude, 'r', marker=True) | |
gmap.draw("onzoMap.html") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment