Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/bbox_to_SpatialPolygons.R
Create a SpatialPolygons Bounding Box
1 | bbox_to_SpatialPolygons(x, proj4string = CRS(as.character(NA)))
|
x |
Raster*, extent, bbox or matrix. See Details. |
proj4string |
CRS object. Used to define the CRS if it is missing from x. |
This function generates a SpatialPolygons object from either a Raster* object, an extent object, a bbox object, or a 2x2 Matrix that follows the form generated by the bbox() function (rows = x and y, cols = min and max). Note that with extent and matrix objects, the CRS will need to be set manually.
A SpatialPolygons object.
Jonathan A. Greenberg
1 2 3 4 5 6 7 8 9 | library("raster")
tahoe_highrez <- brick(system.file("external/tahoe_highrez.tif", package="spatial.tools"))
bbox_to_SpatialPolygons(tahoe_highrez)
tahoe_highrez_extent <- extent(tahoe_highrez)
bbox_to_SpatialPolygons(tahoe_highrez_extent,
CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
tahoe_highrez_bbox <- bbox(tahoe_highrez)
bbox_to_SpatialPolygons(tahoe_highrez_bbox,
CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.