The function'extract_building' extracts the layer 'batiment' from BD TOPO. First it uncompresses the archive '*.7z', typically comming from the use of download.bd_topo(). Then it extracts from 'gpkg file' the 'batiment', 'commune' and 'departement' layers as sf objects, applies scheme to all created sf objects. A selection of 'polygon' is made in 'batiment', to ensure that only those of current 'department' are kept, and the 'commune' to which they belong is added. The projection is set to 'projection'. If asked, the eaip information is added. If asked a map for checking purpose is saved. If asked the resulting sf object is returned (this is not default behaviour). Result is saved according to 'destination' path.

extract_building(
  origin,
  destination,
  archive,
  scheme = floodam.data::scheme_bd_topo_3,
  journal = TRUE,
  map = FALSE,
  path_eaip = NULL,
  projection = 4326,
  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.

scheme

data.frame, how archive variables should be treated.

journal

logical, should a journal file be saved.

map

logical, should a map be plotted (for check purpose).

path_eaip

character, path where eaip archives should be find.

projection

numeric, 4 digits projection to use.

retrieve

logical, should the result be returned.

verbose

logical, should the function give some sumup informations.

Value

if retrieve = TRUE, data.frame of adapated data stored in archive.

Author

Frédéric Grelot