Skip to contents

extract_building() extracts the layer 'batiment' from BD TOPO.

Usage

extract_building(
  origin,
  destination,
  archive,
  scheme = floodam.data::scheme_bd_topo_3,
  projection = 4326,
  path_eaip = NULL,
  journal = TRUE,
  map = FALSE,
  verbose = TRUE,
  retrieve = FALSE
)

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.

projection

numeric, 4 digits projection to use.

path_eaip

character, path where eaip archives should be find.

journal

logical, should a journal file be saved.

map

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

verbose

logical, should the function give some sumup informations.

retrieve

logical, should the result be returned.

Value

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

Details

  • First extract_building() 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.