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_5,
  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. See details

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

Workflow

  • 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.

Scheme

Depending on the vintage of the BD-Topo that wants to be processed, different versions of the scheme should be chosen:

  • scheme_bd_topo_3: valid for vintages from March 2019 to March 2022

  • scheme_bd_topo_3_2: valid for vintage June 2022

  • scheme_bd_topo_3_3: valid for vintages from September 2022 to March 2024

  • scheme_bd_topo_3_4: valid for vintages from June 2024 to March 2025

  • `scheme_bd_topo_3_5“ : valid for vintages from June 2025 to current