adapt_admin_express treats Admin Express archives to be in a standard format. It is suited for IGN archives. It used by default scheme_admin_express_3_1 as scheme. For older versions scheme_admin_express_2_0 is also available.

Beware that codeadapt_admin_express will perform all possibles combinations of archives present in origin and layers available in scheme if those parameters are not specified.

adapt_admin_express(
  origin,
  destination,
  archive,
  layer = NULL,
  scheme = floodam.data::scheme_admin_express_3_1,
  projection = 4326,
  extension = "rds",
  journal = TRUE,
  retrieve = FALSE,
  verbose = TRUE
)

Arguments

origin

character, path to the directory where archive are stored.

destination

character, path to the directory where results should be saved.

archive

character, vector of archive to be adpated.

layer

character, which layer should be treated.

scheme

data.frame, how archive variables should be treated.

projection

integer or object of type CRS giving projection.

extension

character, option for extension and so format of saving of results.

journal

logical, should a journal file be saved.

retrieve

logical, should the result be returned.

verbose

logical, should the function give some sumup informations.

Value

if retrieve = TRUE, sf object of adapated data stored in archive. This may be a list if the function implies recursive calls.

Details

The following treatment are performed:

  • depending on how many archives and layers are to be treated, a recursive call may be perform to do all desired combinations.

  • archive is read with read_with_scheme(), which may imply that it is uncompressed, then read (usually as a shp or a gpkg file), reprojected if asked, and finally adapted.

  • the output is saved as rds in given destination withesave_archive(). The name of archive include a precision depending on the layer chosen. For layer 'COMMUNE', the saving is made by departments.

Author

Frédéric Grelot and Victor Champonnois

Examples


if (FALSE) {
origin = ""
destination = tempdir()
archive = "RPG_2-0__SHP_LAMB93_FR-2018_2018-01-15.7z"
result = adapt_rpg(archive, origin, destination, verbose = TRUE, retrieve = TRUE)
}