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

major changes to separate data extraction from data posttreatment

Showing with 55 additions and 2 deletions
+55 -2
# code to prepare `so_ii_hydro` dataset goes here
# code to prepare `so_ii_catchment` dataset goes here
#selection = c("CdOH", "TopoOH")
file_dir = current_version(
"data-common/so-ii/topage",
pattern = "^[0-9-]+$"
)
so_ii_catchment = sf::st_read(file.path(file_dir, "bassin_versant_so_ii.shp"))
# establishing levels of detail in catchments
so_ii_catchment[["degre"]] = 2
selection_row = list(
mosson = c(
'06B0000002150456066',
'06B0000002150458403',
'06B0000002150458401',
'06B0000002150456007',
'06B0000002150455994'
),
lez = c(
'06B0000002150456086',
'06B0000002150456009'
),
lor = c(
'06B0000002150456068',
'06B0000002150456055',
'06B0000002150456053',
'06B0000002150461370',
'06B0000002150457044'
)
)
bassin_mosson = so_ii_catchment[so_ii_catchment[["id"]] %in% unlist(unname(selection_row[["mosson"]])), ]
bassin_mosson_geom = sf::st_union(bassin_mosson)
bassin_mosson_df = data.frame(
id = "soii01",
bassin = "Bassin Mosson",
degre = 1
)
bassin_mosson = sf::st_set_geometry(bassin_mosson_df, bassin_mosson_geom)
bassin_lez = so_ii_catchment[so_ii_catchment[["id"]] %in% unlist(unname(selection_row[["lez"]])), ]
bassin_lez_geom = sf::st_union(bassin_lez)
bassin_lez_df = data.frame(
id = "soii02",
bassin = "Bassin Lez",
degre = 1
)
bassin_lez = sf::st_set_geometry(bassin_lez_df, bassin_lez_geom)
bassin_lor = so_ii_catchment[so_ii_catchment[["id"]] %in% unlist(unname(selection_row[["lor"]])), ]
bassin_lor_geom = sf::st_union(bassin_lor)
bassin_lor_df = data.frame(
id = "soii03",
bassin = "Bassin L'or",
degre = 1
)
bassin_lor = sf::st_set_geometry(bassin_lor_df, bassin_lor_geom)
so_ii_catchment = rbind(so_ii_catchment, bassin_mosson)
so_ii_catchment = rbind(so_ii_catchment, bassin_lez)
so_ii_catchment = rbind(so_ii_catchment, bassin_lor)
# updating datasets
# actual = setwd(file.path(system.file(package = "geau"), ".."))
......
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