bbox.Rd
retrieves spatial bounding box from spatial data
bbox(obj)
object deriving from class "Spatial"
an array with at least two columns
object deriving from class "Line"
object deriving from class "Lines"
object deriving from class "Polygon"
object deriving from class "Polygons"
two-column matrix; the first column has the minimum, the second the maximum values; rows represent the spatial dimensions
# just 9 points on a grid:
x <- c(1,1,1,2,2,2,3,3,3)
y <- c(1,2,3,1,2,3,1,2,3)
xy <- cbind(x,y)
S <- SpatialPoints(xy)
bbox(S)
#> min max
#> x 1 3
#> y 1 3
# data.frame
data(meuse.grid)
coordinates(meuse.grid) <- ~x+y
gridded(meuse.grid) <- TRUE
bbox(meuse.grid)
#> min max
#> x 178440 181560
#> y 329600 333760