Transform an eBird Status and Trends extent object to a different coordinate reference system. This is most commonly required to transform the extent to the sinusoidal CRS used by the eBird Status and Trends rasters.
project_extent(x, crs)
ebirdst_extent object; a spatiotemporal extent.
coordinate references system, given either as a proj4string, an
integer EPSG code, or a crs
object generated with st_crs()
.
An ebirdst_extent object in the new CRS.
# construct an ebirdst_extent object
bb_vec <- c(xmin = -80, xmax = -70, ymin = 40, ymax = 47)
bb <- sf::st_bbox(bb_vec, crs = 4326)
bb_ext <- ebirdst_extent(bb)
# transform to sinusoidal projection of rasters
sinu <- "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007 +b=6371007 +units=m +no_defs"
project_extent(bb_ext, crs = sinu)
#> eBird Status & Trends extent:
#> Bounding box: xmin -6814428; ymin 4447802; xmax -5308439; ymax 5226167
#> CRS: +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +R=6371007 +units=m +no_defs
#> Temporal extent: 01-01 - 12-31
# also works on polygon extents
poly <- sf::read_sf(system.file("shape/nc.shp", package="sf"))
poly_ext <- ebirdst_extent(poly)
project_extent(poly_ext, crs = sinu)
#> eBird Status & Trends extent:
#> Polygon: 1 MULTIPOLYGON features
#> Bounding box: xmin -7681725; ymin 3767510; xmax -6777465; ymax 4068588
#> CRS: +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +R=6371007 +units=m +no_defs
#> Temporal extent: 01-01 - 12-31