Commit a5719ace authored by David Nortes Martínez's avatar David Nortes Martínez
Browse files

New theme based on the hydrologic network dataset

Showing with 30 additions and 1 deletion
+30 -1
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
#' @param bar logical, should a bar be plotted #' @param bar logical, should a bar be plotted
#' @param path character, the name of the file to save the plot #' @param path character, the name of the file to save the plot
#' @param gaspar_year character, the year chosen for gaspar theme #' @param gaspar_year character, the year chosen for gaspar theme
#' @param hydro_detail character, the niveau of detail in the representation of the hydrographic network
#' @param ... some parameters that will be used by plot (from sf) #' @param ... some parameters that will be used by plot (from sf)
#' #'
#' @return Nothing useful. #' @return Nothing useful.
#' #'
#' @details hydro_detail takes values "1", "2", "3" or "canal"
#'
#' @export #' @export
#' #'
#' @encoding UTF-8 #' @encoding UTF-8
...@@ -24,10 +27,11 @@ ...@@ -24,10 +27,11 @@
map_so_ii = function( map_so_ii = function(
dataset, dataset,
dataset_legend = NULL, dataset_legend = NULL,
theme = c("clc", "gaspar"), theme = c("clc", "gaspar", "hydro"),
bar = TRUE, bar = TRUE,
path = NULL, path = NULL,
gaspar_year, gaspar_year,
hydro_detail,
... ...
) { ) {
...@@ -74,6 +78,31 @@ map_so_ii = function( ...@@ -74,6 +78,31 @@ map_so_ii = function(
) )
} }
if ("hydro" %in% theme) {
if(missing(hydro_detail)) {
hydro_detail = "0"
}
if(hydro_detail == "canal") {
color = scales::alpha("red", .3)
so_ii_hydro_toplot = geau::so_ii_hydro[["geometry"]][geau::so_ii_hydro[["degre"]] == hydro_detail]
lwd = 1
} else {
#color = "#dbe8f0"
color = scales::alpha("blue", .3)
so_ii_hydro_toplot = geau::so_ii_hydro[["geometry"]][geau::so_ii_hydro[["degre"]] <= hydro_detail]
lwd = 4 - as.numeric(geau::so_ii_hydro[["degre"]][geau::so_ii_hydro[["degre"]] <= hydro_detail])
}
plot(
so_ii_hydro_toplot,
col = color,
lwd = lwd,
add=TRUE
)
}
plot(dataset[["geometry"]], add = TRUE, ...) plot(dataset[["geometry"]], add = TRUE, ...)
plot(geau::so_ii_limit, lwd = 2, add = TRUE) plot(geau::so_ii_limit, lwd = 2, add = TRUE)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment