powered by
Calculates the overall bounding box that encompasses all provided spatial shapes.
get_widest_bbox(shapes)
A named numeric vector with elements: ymin, xmin, xmax, ymax
ymin
xmin
xmax
ymax
representing the union of all input bounding boxes.
A list of sf objects.
library(sf) # Load sample data nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) # Get the bounding box of the entire dataset bbox <- get_widest_bbox(list(nc)) bbox
Run the code above in your browser using DataLab