time lapse of transport data in folium

389 Views Asked by At

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?

1

There are 1 best solutions below

0
flipSTAR On

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://python-visualization.github.io/folium/latest/user_guide/plugins/timestamped_geojson.html