Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import folium
  2. from folium.plugins import MarkerCluster
  3. import pandas as pd
  4. cyclemap = folium.Map(location = [51.5074, -0.1278],
  5. tiles='CartoDB positron',
  6. zoom_start = 11,
  7. width = 800, height = 600)
  8.  
  9. cycleincidences = pd.read_csv("2016cyclists.csv")
  10.  
  11. MAX_RECORDS = 50
  12. #using max records for speed as I have almost 5000 data points
  13.  
  14. marker_cluster = folium.MarkerCluster().add_to(cyclemap)
  15.  
  16. for each in cycleincidences[0:MAX_RECORDS].iterrows():
  17. folium.Marker(
  18. location = [each[1]['X'],each[1]['Y']]
  19. ).add_to(marker_cluster)
  20.  
  21. cyclemap.save('cylesmap3.html')
Add Comment
Please, Sign In to add comment