Commit 83b971e7 authored by Grelot Frederic's avatar Grelot Frederic :swimmer_tone5:
Browse files

geau version 1.0.11.0

0 errors :heavy_check_mark: | 0 warnings :heavy_check_mark: | 0 notes :heavy_check_mark:

map_so_ii
	- ajout du theme "osm" pour un fonds OSM (zoom=10)

so_ii_osm
	- ajout de data dans inst/extdata sous format tif
Showing with 55 additions and 3 deletions
+55 -3
Package: geau
Title: Utilities very useful to share within geau-inondation team
Version: 1.0.10.0
Version: 1.0.11.0
Authors@R:
c(
person(given = "Frédéric",
......
......@@ -64,7 +64,7 @@
map_so_ii = function(
dataset,
dataset_legend = NULL,
theme = c("none", "collectivity", "catchment", "catnat", "clc", "hydro", "onrn", "population"),
theme = c("none", "collectivity", "catchment", "catnat", "clc", "hydro", "onrn", "osm", "population"),
theme_legend = FALSE,
detail,
year,
......@@ -97,6 +97,7 @@ map_so_ii = function(
"collectivity" = map_theme_collectivity(detail, theme_legend),
"hydro" = map_theme_hydro(detail, theme_legend),
"onrn" = map_theme_onrn(detail, theme_legend),
"osm" = map_theme_osm(),
"population" = map_theme_population(detail, year, theme_legend),
NULL
)
......@@ -523,6 +524,17 @@ map_theme_onrn = function(detail, add_legend) {
}
}
map_theme_osm = function() {
so_ii_osm = terra::rast(
system.file("extdata", "so_ii_osm.tif", package = "geau", mustWork = TRUE)
)
terra::plot(so_ii_osm, add = TRUE)
graphics::mtext(
text = "Fond de carte : \u00a9 Contributeurs OpenStreetMap",
side = 1, line = -1, adj = 1, cex = .6, font = 3
)
}
map_theme_population = function(detail, year, add_legend) {
if (missing(year)) {
year = utils::tail(sort(colnames(geau::so_ii_population)), 1)
......
# code to prepare `so_ii_osm` dataset goes here
library(sf)
library(maptiles)
so_ii_osm = maptiles::get_tiles(geau::so_ii_limit, zoom = 10, crop = TRUE)
# updating datasets
actual = setwd("geau")
terra::writeRaster(so_ii_osm, "inst/extdata/so_ii_osm.tif", overwrite = TRUE)
setwd(actual)
File added
<PAMDataset>
<PAMRasterBand band="1">
<Description>red</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">253</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">37</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="2">
<Description>green</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">250</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">37</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="3">
<Description>blue</Description>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">246</MDI>
<MDI key="STATISTICS_MEAN">-9999</MDI>
<MDI key="STATISTICS_MINIMUM">37</MDI>
<MDI key="STATISTICS_STDDEV">-9999</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
......@@ -9,7 +9,7 @@ map_so_ii(
dataset,
dataset_legend = NULL,
theme = c("none", "collectivity", "catchment", "catnat", "clc", "hydro", "onrn",
"population"),
"osm", "population"),
theme_legend = FALSE,
detail,
year,
......
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