bbox_to_polygon: Convert a bbox to sp::polygon, sp::Polygons, or...

Description Usage Arguments Value

View source: R/misc.R

Description

Convert a bbox to sp::polygon, sp::Polygons, or sp::SpatialPolygons object

Usage

1
2
3
4
5
6
bbox_to_polygon(
  bb = c(-153.681, -48.59701, 11.37212, 62.08712),
  proj = "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0",
  id = "bbox",
  output_class = c("SpatialPolygons", "Polygons", "Polygon")[1]
)

Arguments

bb

numeric, a 4-element bbox vector [left, right, bottom, top]

proj

character sutiable to pass to sp::CRS

id

character, the polygon ID, by default 'bbox'

output_class

character, either "SpatialPolygons", "Polygons" or "Polygon"

Value

sp::SpatialPolygons object or NULL


BigelowLab/namanl documentation built on Nov. 15, 2021, 3:11 p.m.