0

I have data that resembles routes in the Netherlands. Now I want to show these routes on a folium map using some sort of timelapse.

The underneath code creates a folium map displaying all routes over the last few months. I want however some sort of slide which you can drag to show the routes of for example a specific day in the last few months.

(The slib geopandas dataframe consists the routes of the last few months)

    for i in range(len(slibdata)):
    
       slib = slib.add_child(folium.PolyLine(locations=[routes[i][0], routes[i][1]], weight=slibdata['weight'][i]/3, color=color_, tooltip = f"{slibdata['istOmschr'][i]} >>> {slibdata['ist2Omschr'][i]}" ))
       
   for coord in verwerkers_info:
    
        slib = slib.add_child(folium.CircleMarker(location = [coord[1],coord[2]], tooltip =(coord), radius = 5))

Anything would help!

Maybe this is not possible with folium? But with some other package?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Herwini
  • 371
  • 1
  • 19

1 Answers1

2

look at this example which demonstrates how markers / lines are added depending on their timestamp. At the bottom of the map are controls for sliding through data

https://nbviewer.org/github/python-visualization/folium/blob/main/examples/Plugins.ipynb#Timestamped-GeoJSON

flipSTAR
  • 579
  • 1
  • 4
  • 18