Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import folium
- from folium.plugins import MarkerCluster
- import pandas as pd
- cyclemap = folium.Map(location = [51.5074, -0.1278],
- tiles='CartoDB positron',
- zoom_start = 11,
- width = 800, height = 600)
- cycleincidences = pd.read_csv("2016cyclists.csv")
- MAX_RECORDS = 50
- #using max records for speed as I have almost 5000 data points
- marker_cluster = folium.MarkerCluster().add_to(cyclemap)
- for each in cycleincidences[0:MAX_RECORDS].iterrows():
- folium.Marker(
- location = [each[1]['X'],each[1]['Y']]
- ).add_to(marker_cluster)
- cyclemap.save('cylesmap3.html')
Add Comment
Please, Sign In to add comment