Skip to contents

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.

Usage

reproj_bbox(bbox, in_proj, out_proj, enlarge = TRUE)

Arguments

bbox

The input bounding box (it can be a matrix obtained from sp::bbox(), or a numeric vector in the format (xmin, ymin, xmax, ymax)).

in_proj

(crs | character) crs of the input projection, or string coercible to it using sf::st_crs() (e.g., WKT or numeric EPSG code)

out_proj

crs crs of the output projection, or string coercible to it using sf::st_crs() (e.g., WKT or numeric EPSG code)

enlarge

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

Note

License: GPL 3.0

Author

Luigi Ranghetti, phD (2015)