-
-
Save loopingleo/dc846873c6ac93168e2502894b834282 to your computer and use it in GitHub Desktop.
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
## ---------- PLOT ON OSM MAP with folium ---------------------------- | |
locationlist = df_compressed[["lat","lon"]].dropna().values.tolist() | |
map = folium.Map(location=[np.mean(df_compressed['lat']), np.mean(df_compressed['lon'])], zoom_start=7) | |
for point in range(0, len(locationlist), 20): | |
if abs(df_compressed.speed[point]) < 3 / 3.6: | |
folium.Circle(locationlist[point], radius=1,#/(1+ (df_compressed["speed"][point])**(2)), | |
color='#00d4ff', fill=True, fill_color ='#00d4ff', fill_opacity=0.2, | |
stroke = True, weight = 0.1).add_to(map) | |
folium.TileLayer('cartodbdark_matter').add_to(map) | |
#folium.TileLayer('cartodbpositron').add_to(map) | |
#folium.TileLayer('Stamen Toner').add_to(map) | |
map | |
filepath = 'your_map_filename.html' | |
map.save(filepath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment