Created
June 8, 2018 18:10
-
-
Save jsta/1b339d91043de98c3589b1bb3fb7db77 to your computer and use it in GitHub Desktop.
Pull elevation data with the elevatr package and rayshade with rayshader package
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(raster) | |
| library(elevatr) | |
| library(rayshader) | |
| library(reshape2) | |
| library(ggplot2) | |
| data(lake) | |
| x <- get_elev_raster(lake, z = 12) | |
| x_mat <- as.matrix(x) | |
| x_rsh <- rayshader::rayshade(x_mat, | |
| anglebreaks = seq(55,65,10), | |
| sunangle = 315, | |
| maxsearch = 100) | |
| ggplot(data = reshape2::melt(x_rsh)) + | |
| geom_tile(aes(x = Var1, y = Var2, fill = value)) + | |
| scale_fill_viridis_c() + | |
| theme_void() + | |
| theme(legend.position = "none") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment