knitr::opts_chunk$set( collapse = TRUE, comment = "#>", message = FALSE, warning = FALSE )
library(zonal) library(geogrids) library(dplyr)
base = geo_path() AOI = AOI::aoi_get(state = "south", county = "all") plot(AOI$geometry)
lai_files = geo_cache_list() %>% filter(grepl('MOD13A3.006/conus', fullname)) %>% pull(fullname) soil_files = geo_cache_list() %>% filter(grepl('silt-1m-percent.tif', fullname)) %>% pull(fullname)
r emo::ji("sad")
make_grid(lai_files[1]) make_grid(soil_files[1])
system.time({ out = geogrid_warp(lai_files[1], make_grid(soil_files[1]), disk = TRUE) w = zonal::weighting_grid(out, AOI, "geoid") oo = execute_zonal(out, w) }) head(oo)
# Assuming the weight grid is precomputed... system.time({ out = geogrid_warp(lai_files[1], make_grid(soil_files[1]), disk = TRUE) oo = execute_zonal(out, w) })
a = merge(AOI, oo) plot(a['X1.km.monthly.NDVI'], border = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.