Day 1 of 30DayMapChallenge: « Points » (previously).
IGN is scanning France using LIDAR. More than half the country is available for downloading currently. Let’s play with points around the Aiguille du Midi…
library(readr)
library(dplyr)
library(purrr)
library(fs)
library(lidR)
dir_create("tiles")
Selecting 4 squares on the selection map allows to generate a catalog of 1✕1 km tiles to download.
read_lines("liste_dalle.txt") |>
tibble(url = _) |>
mutate(file = path("tiles", path_file(url))) |>
pwalk(\(url, file) download.file(url, file))
Read and manipulate the LAZ files with the help of the {lidR} package. We only keep a region of interest 500 m around the peak.
<- readLAScatalog("tiles")
ctg <- clip_circle(ctg, x = 1001400, y = 6538400, radius = 500) roi
The point cloud has already been classified so we can extract only the ground (although at this altitude there is no vegetation).
<- filter_ground(roi)
ground plot(ground)
We display 38 millions points (50 points/m²)!
And then we can create a digital terrain model and a hillshade map…
<- rasterize_terrain(roi, 2, tin(), pkg = "terra")
dtm <- terra::terrain(dtm, v = c("slope", "aspect"), unit = "radians")
dtm_prod <- terra::shade(slope = dtm_prod$slope, aspect = dtm_prod$aspect)
dtm_hillshade plot(dtm_hillshade, col = gray(0:50/50), legend = FALSE)