bbox2poly: Convert a bounding box to polygon

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert a bounding box to polygon

Usage

1
bbox2poly(bbox)

Arguments

bbox

object of class bbox from sf

Value

An sfc object from the sf package

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
library(sf)
wk <- wikilake::lake_wiki("Gull Lake (Michigan)")

pnt <- st_as_sf(wk, coords = c("Lon", "Lat"), crs = 4326)
pnt <- st_transform(pnt, st_crs(vpu_shp))
qry <- nhd_plus_query(wk$Lon, wk$Lat,
  dsn = c("NHDWaterbody"), buffer_dist = 0.05)
wbd <- qry$sp$NHDWaterbody[which.max(st_area(qry$sp$NHDWaterbody)), ]
bbox2poly(st_bbox(wbd))

## End(Not run)

nhdR documentation built on July 17, 2021, 5:06 p.m.