Skip to content

Instantly share code, notes, and snippets.

@mikemahoney218
Created November 9, 2021 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemahoney218/8b8ad552c8daed04701fc519d7405bdd to your computer and use it in GitHub Desktop.
Save mikemahoney218/8b8ad552c8daed04701fc519d7405bdd to your computer and use it in GitHub Desktop.
Code for my map for day 11 of the 30 Day Map Challenge on November 11, 2021 ("3D")
library(terrainr)
library(sf)
library(progressr)
handlers("progress")
Washington <- tmaptools::geocode_OSM("Mount Washington")
Washington <- Washington$coords
Washington <- data.frame(
lat = Washington[["y"]],
lng = Washington[["x"]]
)
Washington <- st_as_sf(Washington, coords = c("lng", "lat"))
Washington <- st_set_crs(Washington, 4326)
Washington <- set_bbox_side_length(Washington, 8000)
with_progress(
output_tiles <- get_tiles(Washington,
services = c("elevation", "ortho"))
)
merged_tiles <- mapply(\(x, y) merge_rasters(x, y, overwrite = TRUE), x = output_tiles, y = c("elevation.tif", "ortho.tif"))
make_manifest(merged_tiles[[1]], merged_tiles[[2]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment