diff --git a/geau/R/map_so_ii.r b/geau/R/map_so_ii.r index b1edc391c566ed460827bf2e4f4b906dd86c4b4a..69b9aa0ef5ab10bef2c94d39066806839d4dc5b3 100644 --- a/geau/R/map_so_ii.r +++ b/geau/R/map_so_ii.r @@ -31,7 +31,7 @@ map_so_ii = function( dataset, dataset_legend = NULL, - theme = c("none", "clc", "catnat", "hydro", "population"), + theme = c("none", "clc", "catnat", "hydro", "population", "catchment"), bar = TRUE, path = NULL, legend_theme = FALSE, @@ -196,6 +196,33 @@ map_so_ii = function( ) } + if ("catchment" %in% theme) { + if (missing(detail)) { + detail = "0" + } + detail = match.arg( + as.character(detail), + choices = c("0", "1", "2") + ) + selection = geau::so_ii_catchment[["degre"]] == detail + geometry = geau::so_ii_catchment[["geometry"]][selection] + border = "grey80" + color = scales::alpha("grey80", .5) + lwd = 1 + plot(geometry, border = border, col = color, lwd = lwd, add = TRUE) + + theme_legend = list( + title = sprintf("Unit\u00e9 administrative"), + legend = "Bassin versant", + x = "topright", + cex = .8, + bg = "white", + inset = 0.01, + fill = unique(color), + border = border + ) + } + if (!missing(dataset)) plot(dataset[["geometry"]], add = TRUE, ...) plot(geau::so_ii_limit, lwd = 2, add = TRUE)