Helper function used to reproject bounding boxes; setting the parameter 'enlarge' allows to choose if the new one would be the one which completely includes the original extent in the output projection, or if is simply the one obtained by reprojecting the upper-left and the lower-right corners.
reproj_bbox(bbox, in_proj, out_proj, enlarge = TRUE)The input bounding box (it can be a matrix obtained from sp::bbox(),
or a numeric vector in the format (xmin, ymin, xmax, ymax)).
(crs | character) crs of the input projection,
or string coercible to it using sf::st_crs() (e.g., WKT or numeric
EPSG code)
crs crs of the output projection, or string coercible to
it using sf::st_crs() (e.g., WKT or numeric EPSG code)
`logical`` if TRUE, the reprojected bounding box is the one which completely include the original one; if FALSE, it is simply the one obtained by reprojecting the upper-left and the lower-right corners.
Luigi Ranghetti, phD (2015)