library(rayshader)
library(raster)
library(tidyverse)
library(fs)
library(httr)
library(glue)
<- path_expand("~/data/bdalti/974")
data_dir
# https://geoservices.ign.fr/bdalti
if (!dir_exists(data_dir)) {
dir_create(data_dir)
GET("https://wxs.ign.fr/aqd29otkz2hofiee5pb0fygn/telechargement/prepackage/BDALTI-25M_PACK_REU_14-12-2020$BDALTIV2_2-0_25M_ASC_RGR92UTM40S-REUN89_D974_2016-03-11/file/BDALTIV2_2-0_25M_ASC_RGR92UTM40S-REUN89_D974_2016-03-11.7z",
write_disk(glue("{data_dir}/dl.7z")))
system(glue("7z e -y -o{data_dir} {data_dir}/dl.7z"))
}
# We get a bunch of ASCII files : open and merge, convert to matrix used by rayshader
<- dir_ls(data_dir, glob = "*.asc") %>%
elmat map(raster) %>%
reduce(merge) %>%
raster_to_matrix()
%>%
elmat sphere_shade(texture = "desert") %>%
add_shadow(ray_shade(elmat, zscale = 3), 0.5) %>%
add_shadow(ambient_shade(elmat), 0) %>%
plot_3d(elmat, zscale = 10, fov = 0, theta = 135, zoom = 0.75, phi = 45, windowsize = c(1000, 800))
render_snapshot("reunion_3d.jpeg")
Day 16 of 30DayMapChallenge: « minimal » (previously).
Bare Réunion…