5  Les cartes en 3D

5.1 linemap

Le package linemap (Giraud, 2023a) permet de réaliser des cartes composées de lignes.

library(linemap)
library(sf)
library(terra)
#> terra 1.7.71
library(mapsf)
com <- st_read("data/lot.gpkg", layer = "communes", quiet = TRUE)
elev <- rast("data/elev.tif")
cahors <- st_buffer(com[com$NOM_COM == "Cahors", ], 5000)
elev_cahors <- crop(elev, cahors)
mf_theme("green")
mf_map(cahors, col = NA, border = NA, expandBB = c(-.05,0,0.05,0))
linemap(x = elev_cahors,
        k = 5, 
        bg = getOption("mapsf.bg"), 
        add = TRUE, lwd = 1)
mf_title("Altitude vers Cahors")
mf_credits("Giraud & Pecout, 2023")

5.2 Relief Tanaka

Nous utilisons le package tanaka (Giraud, 2023b) qui met à disposition une méthode (Tanaka, 1950) utilisée pour améliorer la perception du relief.

library(tanaka)
library(terra)
mf_theme("candy")
mf_map(cahors, col = NA, border = NA)
tanaka(elev_cahors, 
       breaks = seq(100,375,25), 
       col = hcl.colors(11, "Lajolla"), 
       add = TRUE)
mf_title("Altitude vers Cahors")
mf_credits("Giraud & Pecout, 2023")