getExtentOfList: Get extent of list

View source: R/getExtentOfList.R

getExtentOfListR Documentation

Get extent of list

Description

Given a list of SpatialPolygons or sf objects, return a bounding box object that encompasses all items.

Usage

getExtentOfList(shapes)

Arguments

shapes

a list of SpatialPolygons or simple features

Value

An object of class bbox.

Author(s)

Pascal Title

Examples


data(crotalus)

# create some polygons, in this case convex hulls
sp <- split(crotalus, crotalus$genSp)
sp <- lapply(sp, function(x) x[,c('decimallongitude','decimallatitude')])
sp <- lapply(sp, function(x) x[chull(x),])
poly <- lapply(sp, function(x) 
	sf::st_convex_hull(sf::st_combine(sf::st_as_sf(x, coords = 1:2, crs = 4326))))

getExtentOfList(poly)


rangeBuilder documentation built on Oct. 31, 2024, 1:08 a.m.