This file contains 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
#https://twitter.com/AnalyticalEdge/status/1582206425585324034 | |
library(ggplot2) | |
library(stars) | |
library(sf) | |
library(dplyr) | |
library(plotly) | |
.d <- dim(volcano) |
This file contains 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
#' download drive files from dribble with path column | |
#' | |
#' @param x a dribble with path column | |
#' @param .overwrite logical. Should files be overwritten | |
#' | |
#' @return The original input dribble | |
#' @noRd | |
drive_down_files <- function(x, .overwrite = TRUE) { | |
This file contains 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
#' @title get administritive outlines for a country | |
#' @description using the geoBoundaires API, | |
#' download the geojson outline of a country | |
#' @param country character vector of country names | |
#' @param admin_level character vector of admin levels to download | |
#' @return sf object of the outlines | |
#' @details check out the documentation for the geoboundaries API at: | |
#' geoBoundaries.org | |
#' | |
geo_bounds <- function(country, admin_level = c("ADM0", "ADM1", "ADM2")) { |
This file contains 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
#' Buffer a point along a terrain surface. | |
#' | |
#' @param dtm A SpatRaster Digital Terrain Model | |
#' @param pnts A SpatVector of points | |
#' @param .dist Numeric - the buffer distance. | |
#' @param .res Numeric - approximate resampling resolution of the (internally | |
#' calculated) cost raster. | |
#' @param .smooth Logical default FALSE. Should the output buffer be smoothed using `smoothr::smooth`? | |
#' @param .method The smoothing method to use - see `smoothr::smooth` for details. | |
#' @param ... Passed to `smoothr::smooth` for eg. to control smoothness. |
This file contains 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 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
# An R script showing how to create a 3D night-time scene of the 'City of London' borough with {EAlidaR } and {Rayshader} | |
# If you don't already have the {EAlidaR package} Run: | |
# devtools::install_github('h-a-graham/EAlidaR') | |
library(EAlidaR) | |
library(raster) | |
library(sf) | |
library(tidyverse) | |
library(here) |
OlderNewer