Determines min. area bounding box for a single or set of spatial polygons

minBBoxSpatialPolygons(x)

Arguments

x

A SpatialPolygonsDataFrame

Value

A SpatialPolygonsDataFrame with corresponding bounding boxes

Examples

file_nm <- system.file("extdata/dflow_runout_ply.shp", package="runout.opt") slide_plys <- rgdal::readOGR(file_nm)
#> OGR data source with driver: ESRI Shapefile #> Source: "/home/jason/R/x86_64-pc-linux-gnu-library/4.0/runout.opt/extdata/dflow_runout_ply.shp", layer: "dflow_runout_ply" #> with 6 features #> It has 27 fields #> Integer64 fields read as strings: FID_1 OBJECTID OBJECTID_1 FID_2 OBJECTID_2 ID ID_COL Dif_rango
#> Warning: Z-dimension discarded
minbb <- minBBoxSpatialPolygons(slide_plys) sp::plot(slide_plys)
sp::plot(minbb, add = TRUE)