Any plan to support some sort of timeline like the one provided by plugin in leaflet?
Hi:
First of all, congratulations for this awesome package.
In our work (a city council), we need to display a time series of maps. I managed to convince some colleagues to use tmap for some other use cases, but when we have the need to display some timeline of maps, I don't know if I can suggest them to keep using tmaps for this need.
However I've seen that there seems to be some plugin in leaflet to do so, and some other packages in the R ecosystem porting that feature: https://github.com/timelyportfolio/leaftime > addTimeline()
Is there any plan to port something similar to tmap? (so that we don't need to move back to leaflet maps from within R in those places where we were happily using tmap so far)
Thanks in advanced
That is a great feature. Great work @timelyportfolio!
At the moment leaftime does not seem very mature (yet). So I am unsure whether to include (import) this in tmap as it is, or perhaps place it in the list of suggested packages.
Also, I am not sure whether all spatial objects are supported. For instance, are rasters also supported? It would be great to use this in combination with spatiotemporal arrays from the stars package.
What do you think, @Nowosad and @tim-salabim?
I've been meaning to see if and how we can use it for space-time vector classes & space-time stars objects, but have been focussing on other more pressing things recently.
That said, I think the new leafem::addGeotiff functionality can potentially be used natively as we can theoretically read multiple files and then use arbitrary javascript functionality to modify them (e.g. calculate things over bands such as NDVI). I guess this could also work for time animations. But let's see. I think a combination of both would be ideal. Have leafem::addGeotiff deal with raster vis and use leaftime::addTimeline to animate over time. Though, just like yourself, I am not sure whether it actually supports raster data. For vector data, I think it's just a matter of transposing it into the expected format, though that might be tricky to generalise.
@tim-salabim leaflet::addTimeline is designed to work with GeoJSON, so I don't think we can use it for this purpose. I'll see if I can find something that we migt be able to repurpose. For a little more detail on how Leaflet.timeline works, the plugin creates an IntervalTree for speedy lookup and then when time changes lines use the tree to add/remove layers in/out of the specified interval/range. For Geotiff, I think we would need to manipulate pixel values (not leaflet layers) for the range/interval.