This is a followup question on How to create animation of vehicle moving form A to B along a route?. I could learn how to animate vehicles moving from A to B along the route. Thanks for the help!
But is it possible to make a self explanatory video (for a hypothetical client) by adding timeline (with a moving marker showing the instantaneous time and the corresponding event). Example of timeline
For example - Here is a sample sequence of events -
library(sf)
library(dplyr)
library(tidygeocoder)
library(osrm)
library(lubridate)
# adresses
adresses <- c("285 Fulton St, New York, NY 10007", # One World Trade Center
"11 Madison Ave, New York, NY 10010",
"Rockefeller Center, 45 Rockefeller Plaza, New York, NY 10111")
# geocoded addresses
geocoded_addresses <- tidygeocoder::geo(adresses, method = "osm") %>%
st_as_sf(coords = c("long", "lat"), crs = 4326)
# reference time
t <- as_datetime("2021-08-23 8:00:00", tz = "America/New_York")
timeline <- tibble(
time = c(t, t+minutes(10), t+minutes(12), NA, t+minutes(25), t+minutes(30), t+minutes(32), NA, t+minutes(38), NA),
events = c("Wait", "Ride request", "Start trip", "End trip", "Ride request", "Start trip", "Ride request", "End trip", "Start trip", "End trip")
)
tmap
,gganimate
, ormapdeck
for the animation? – Condensatetmap
. I can create the full animation on my own intmap
now . The most important thing is add a timeline belo the plot (with a moving cursor pointing time and the current event). The idea is to create a self explanatory gif or mp4. – Knowing