Skip to contents

generate a bounding box based on a sf/sp (readable) object

Usage

inflate_bbox(sp_obj, value, wgs = TRUE)

Arguments

sp_obj

Either an sf object or an sf-readable file. See sf::st_drivers() for available drivers. used as the basis for the bounding box.

value

A numeric distance (in the units of the spatial object) to inflate the bounds by.

wgs

Boolean to determine if box should be defined in WGS84 CRS. default is TRUE as this plays more nicely with ggspatial...

Value

object of class "bbox" containing the spatial coordinates of a bounding area

Examples


# generate inflated (by 10m) bounding box for ROBT feeding signs
inflate_bbox(RivOtter_FeedSigns, 10)
#> Simple feature collection with 1 feature and 0 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 305466.8 ymin: 82137.99 xmax: 322774.8 ymax: 114169.4
#> Projected CRS: OSGB 1936 / British National Grid
#>                         geometry
#> 1 POLYGON ((305466.8 82137.99...