-
Notifications
You must be signed in to change notification settings - Fork 7
/
30_amap.R
39 lines (33 loc) · 1011 Bytes
/
30_amap.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# #30DayMapChallenge
# Día 30: Un mapa
# Densidad de poblacion sudamerica
# Datos: https://sedac.ciesin.columbia.edu/data/set/gpw-v4-population-density-adjusted-to-2015-unwpp-country-totals-rev11/data-download
# Autora: Stephanie Orellana (@sporella)
library(raster)
library(rayshader)
r <- raster("data/densidad_poblacion_sudamerica_2020_5min.tif")
elmat = raster_to_matrix(r)
elmat %>%
sphere_shade(texture = create_texture("springgreen", "darkgreen",
"turquoise", "steelblue3", "white")) %>%
add_shadow(ray_shade(elmat, zscale = 150), 0.5) %>%
plot_3d(
elmat,
zoom = 0.55,
theta = 0,
phi = 45,
fov = 0,
zscale = 150,
soliddepth = -3,
windowsize = c(800, 720)
)
text <- paste0("DENSIDAD DE POBLACIÓN\nSUDAMÉRICA",
strrep("\n", 34),
"@sporella")
render_snapshot(
filename = "plots/30_poblacionsudamerica.png",
title_text = text,
title_size = 16,
title_color = "grey50",
clear = T
)