Last active
November 20, 2020 22:00
-
-
Save mikemahoney218/5b429443bcdbb41452d2d4547e773275 to your computer and use it in GitHub Desktop.
Code to create my entry for day 12 of the 2020 30 Day Map Challenge
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(rayshader) | |
katahdin <- tmaptools::geocode_OSM("mt katahdin") | |
downloaded_tiles <- get_bbox(lat = katahdin$coords["y"], | |
lng = katahdin$coords["x"]) %>% | |
set_bbox_side_length(2000) %>% | |
get_tiles() | |
katahdin_raster <- raster::raster(downloaded_tiles[[1]]) | |
katahdin_matrix <- matrix(katahdin_raster, | |
nrow = katahdin_raster@ncols, | |
ncol = katahdin_raster@nrows | |
) | |
katahdin_height <- height_shade(katahdin_matrix) %>% | |
add_water(detect_water(katahdin_matrix), | |
color = "imhof4") %>% | |
add_shadow(ambient_shade(katahdin_matrix), | |
max_darken = 0.3) %>% | |
add_shadow(ray_shade(katahdin_matrix), | |
max_darken = 0.3) %>% | |
add_overlay(generate_contour_overlay(katahdin_matrix)) | |
plot_3d(katahdin_height, katahdin_matrix, windowsize = 1200) | |
render_movie("12_nongis") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment