Get Extent of sf objects

sf_extent(x)

Arguments

x

sf object

Value

a raster Extent

Details

This function exists to avoid raster needing the sf package. We don't need GDAL, GEOS, and all the other fun stuff to find four numbers that describe coordinate range, so this is a workaround.

Examples

sf_extent(silicate::inlandwaters)
#> class : Extent #> xmin : -681074.5 #> xmax : 2477934 #> ymin : -2677570 #> ymax : 1113843