bbox-methods {sp} | R Documentation

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

### Value

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

### Methods

obj = "Spatial"
  object deriviving from class "Spatial"
obj = "Line"
  object deriviving from class "Line"
obj = "Lines"
  object deriviving from class "Lines"
obj = "Polygon"
  object deriviving from class "Polygon"
obj = "Polygons"
  object deriviving 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)

[Package sp version 0.7-12 Index]