Learn R Programming

pedometrics (version 0.6-3)

bbox2sp: Create Spatial object from a bounding box

Description

This function takes the bounding box of a Spatial* object and creates a SpatialPoints* or SpatialPolygons* object from it.

Usage

bbox2sp(obj, sp = "SpatialPolygons", keep.crs = TRUE)

Arguments

obj
Object of class Spatial*.
sp
Class of the resulting object. Available options are "SpatialPoints", "SpatialPointsDataFrame", "SpatialPolygons" and "SpatialPolygonsDataFrame".
keep.crs
Logical for assigning the same coordinate reference system to the resulting Spatial* object.

Value

  • An object of class SpatialPoints* or SpatialPolygons*.

References

Edzer Pebesma, Jon Skoien with contributions from Olivier Baume, A. Chorti, D.T. Hristopulos, S.J. Melles and G. Spiliopoulos (2013). intamapInteractive: procedures for automated interpolation - methods only to be used interactively, not included in intamap package. R package version 1.1-10. http://CRAN.R-project.org/package=intamapInteractive

Examples

Run this code
require(sp)
data(meuse)
coordinates(meuse) <- ~ x + y
bbox2sp(meuse, keep.crs = FALSE)

Run the code above in your browser using DataLab