bbox_polygon: Create a st_polygon from a bounding box

View source: R/bboxPolygon.R

bbox_polygonR Documentation

Create a st_polygon from a bounding box

Description

Really useful function to define bounding box enveloppe

Usage

bbox_polygon(shp, buffer = 0)

Arguments

shp

sf or sfc object that we want to bound within some box

buffer

dist to add around the bounding box to avoid the weird boundary effects

Details

See https://stackoverflow.com/questions/45719790/create-voronoi-polygon-with-simple-feature-in-r

Value

st_polygon forming a box

Examples

## Not run: 
shp_trees <-  st_read('https://www.donneesquebec.ca/recherche/dataset/bc5afddf-9439-4e96-84fb-f91847b722be/resource/bbdca0dd-82df-42f9-845b-32348debf8ab/download/vdq-arbrepotentielremarquable.geojson')
shp_trees %>% bbox_polygon()

## End(Not run)


cgauvi/sfSpHelpers documentation built on June 30, 2023, 10:48 p.m.