Skip to contents

Takes a list of sf objects and compute the bounding box that covers them all.

Usage

dc_combine_bbox(list_layers)

Arguments

list_layers

A list of sf objects

Value

An sf bounding box is returned.

Examples

library(sf)

# Read source points
source_pts <- st_read(
  dsn = system.file("gpkg/data-prefecture.gpkg", package = "distanamo"),
  layer = "prefecture", quiet = TRUE
)

# Read the background layer to deform
background_layer <- st_read(
  dsn = system.file("gpkg/data-prefecture.gpkg", package = "distanamo"),
  layer = "departement", quiet = TRUE
)

bbox <- dc_combine_bbox(list(source_pts, background_layer))
bbox
#>      xmin      ymin      xmax      ymax 
#>   99217.1 6137115.5 1082898.1 7110480.1