Skip to content

Instantly share code, notes, and snippets.

@tim-fan
Created February 25, 2018 08:12
Show Gist options
  • Save tim-fan/736bbaf79dfd5235111619612fde3a1c to your computer and use it in GitHub Desktop.
Save tim-fan/736bbaf79dfd5235111619612fde3a1c to your computer and use it in GitHub Desktop.
Plot Onzo bike locations on google maps
#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