Skip to content

continuous time spent #15

@mdsumner

Description

@mdsumner

cut.trip does most of the work, but it seems to add in a stray day with the walrus data.

library(trip)
data(walrus818)
prj <- "+proj=laea +lon_0=-165 +lat_0=90 +ellps=WGS84"
walrus <- spTransform(walrus818, prj)

grid <- rasterize(walrus)

#grid <- rasterize(tr[[1]], method = "density")
tr <- cut(walrus, "1 day")
library(raster)
library(tibble)
library(dplyr)
tib1 <- function(x) {
  bind_cols(as_tibble(as.data.frame(x)), tibble(cell = seq(ncell(x)))) %>% filter(z > 0)
}
st <- bind_rows(lapply(tr, function(x) tib1(rasterize(x, grid = grid))), .id = "interval")
sum(st$z)
[1] 45500400
> cellStats(gg, sum)
[1] 44640000

Somewhere here is integration with splat/SGAT and tabularaster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions