Created
November 9, 2021 02:16
-
-
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")
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(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