Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bbox

retrieve bbox from spatial data


Description

retrieves spatial bounding box from spatial data

Usage

bbox(obj)

Arguments

obj

object deriving from class "Spatial", or one of classes: "Line", "Lines", "Polygon" or "Polygons", or ANY, which requires obj to be an array with at least two columns

Value

two-column matrix; the first column has the minimum, the second the maximum values; rows represent the spatial dimensions

Methods

obj = "Spatial"

object deriving from class "Spatial"

obj = "ANY"

an array with at least two columns

obj = "Line"

object deriving from class "Line"

obj = "Lines"

object deriving from class "Lines"

obj = "Polygon"

object deriving from class "Polygon"

obj = "Polygons"

object deriving from class "Polygons"

Examples

# 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)

# data.frame
data(meuse.grid)
coordinates(meuse.grid) <- ~x+y
gridded(meuse.grid) <- TRUE
bbox(meuse.grid)

sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.