bbox_from_vector: Create an sf bounding box from a vector with...

View source: R/bboxPolygon.R

bbox_from_vectorR Documentation

Create an sf bounding box from a vector with (xmin,ymin,ymax,ymax)

Description

This works automatically with raster extents or sf::bbox

Usage

bbox_from_vector(
  v,
  crs,
  x_name_min = "xmin",
  y_name_min = "ymin",
  x_name_max = "xmax",
  y_name_max = "ymax"
)

Arguments

v

vector with names (xmin,ymin,ymax,ymax)

x_name_min

character

y_name_min

character

x_name_max

character

y_name_max

character

Value

sf object representing bbox

Examples

## Not run: 
library(sf)

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')
rasterKDECentroids <- st_kde(shp_trees , cellsize = 0.001, bandwith =c(.001, .001 ) )
bbox_from_vector(extent(rasterKDECentroids) , crs=4326)


## End(Not run)

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