You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(trip)
tr<-...## overall extent for tripr<-raster::raster(spex::buffer_extent(tr, 1), res=0.1, crs=raster::projection(tr))
## turn into line segments, with timedur on eachlines<- explode(tr)
cells<-tabularaster::cellnumbers(r, lines)
library(dplyr)
## now cells has object_ (the line segment), and cell_ (the pixel index)## copy on timedur and id and starttimecells<-cells %>% mutate(starttime=lines$starttime[object_],
timedur=lines$timedur[object_],
id=lines$id[object_])
## we have to distribute the timedur evenly across each cell (it's close enough)cells<-cells %>% group_by(object_) %>% mutate(timedur=timedur/ n()) %>% ungroup()
## we can get the lon/lat from the rastercells<-cells %>% mutate(lon=raster::xFromCell(r, cell_), lat=raster::yFromCell(r, cell_))
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: