Learn R Programming

rcrisp (version 0.3.1)

as_bbox: Get the bounding box from the x object

Description

If the x does not have a CRS, WGS84 is assumed.

Usage

as_bbox(x)

Value

A bbox object as returned by sf::st_bbox()

Arguments

x

Simple feature object (or compatible) or a bounding box, provided either as a matrix (with x, y as rows and min, max as columns) or as a vector (xmin, ymin, xmax, ymax)

Examples

Run this code
library(sf)
bounding_coords <- c(25.9, 44.3, 26.2, 44.5)
bb <- as_bbox(bounding_coords)
class(bb)
st_crs(bb)

Run the code above in your browser using DataLab