library(raster)
#> Loading required package: sp
library(stars)
#> Loading required package: abind
#> Loading required package: sf
#> Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is TRUE
library(terra)
#> terra 1.5.23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Warp and plot the EGM2008 1' geoid model | |
# geoid COGS hosted here: https://www.agisoft.com/downloads/geoids/ | |
library(vapour) | |
library(gdalio) | |
library(terra) | |
source(system.file("raster_format/raster_format.codeR", package = "gdalio", mustWork = TRUE)) | |
geoid <- '/vsicurl/https://s3-eu-west-1.amazonaws.com/download.agisoft.com/gtg/us_nga_egm2008_1.tif' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(gdalio) | |
library(terra) | |
library(viridisLite) | |
source(system.file("raster_format/raster_format.codeR", package = "gdalio", mustWork = TRUE)) | |
Sys.setenv(GOOGLE_APPLICATION_CREDENTIALS = "MYKEY.json") | |
gee_src <- "EEDAI:CGIAR/SRTM90_V4" | |
src_info <- vapour::vapour_raster_info(gee_src) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rstac) | |
library(sf) | |
library(raytrix) | |
library(rayshader) | |
# set region and search stac! | |
region <- st_bbox(st_buffer(st_point(c(-151.739,-16.501)), 0.063)) %>% | |
st_as_sfc() %>% | |
st_set_crs(4326) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#rstac example/test | |
library(vapour) | |
library(gdalio) | |
library(rstac) | |
library(sf) | |
library(dplyr) | |
library(scico) | |
source(system.file("raster_format/raster_format.codeR", package = "gdalio", mustWork = TRUE)) | |
# get random swiss region |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#anglr questions | |
# example... | |
library(gdalio) | |
library(rayshader) | |
library(topography) | |
library(gdalwebsrv) | |
library(anglr) | |
source(system.file("raster_format/raster_format.codeR", package = "gdalio", mustWork = TRUE)) | |
#functions... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example... | |
library(gdalio) | |
library(rayshader) | |
library(topography) | |
library(gdalwebsrv) | |
rotate <- function(x) t(apply(x, 2, rev)) | |
gdalio_rayshader_matrix <- function(dsn, ...) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!"here" %in% installed.packages()[,"Package"]) install.packages('here') | |
library(here) | |
dir_home <- here() | |
# Function to un-nest all files in sub directories. | |
unnest_dir <- function(.root, sep="_DIR_SEP_"){ | |
#list all the files in the directory and sub dirs | |
files <- list.files(.root, full.names = F, recursive = T) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# easy height data for rayshader | |
# remotes::install_github("hypertidy/topography") | |
library(gdalio) | |
library(topography) | |
library(sf) | |
library(rayshader) | |
library(scico) | |
library(dplyr) | |
# ------ get data ------------- | |
# Get county data for England and Wales |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Raster Mask Benchmark | |
library(sf) | |
library(terra) | |
library(dplyr) | |
library(elevatr) | |
library(microbenchmark) | |
# library(tictoc) | |
library(bench) | |
# ------ get data ------------- |