as.SpatialPolygons.bbox: Convert a bounding box to a SpatialPolygons object Bounding...

Description Usage Arguments Value See Also Examples

View source: R/R-GIS.R

Description

Convert a bounding box to a SpatialPolygons object Bounding box is first created (in lat/lon) then projected if specified

Usage

1
2
3
as.SpatialPolygons.bbox(bbox,
  proj4stringFrom = sp::CRS("+proj=longlat +datum=WGS84"),
  proj4stringTo = NULL, interpolate = 0)

Arguments

bbox

Bounding box: a 2x2 numerical matrix of lat/lon coordinates (rownames must be c('lat','lon') and colnames must be c('min','max'))

proj4stringFrom

Projection string for the current bbox coordinates (defaults to lat/lon, WGS84)

proj4stringTo

Projection string, or NULL to not project

interpolate

If nonzero, the number of nodes per side to add in (helps maintain coverage if you're projecting)

Value

A SpatialPolygons object of the bounding box

See Also

clipToExtent which uses the output of this to clip to a bounding box

Examples

1
2
3
4
bb <- matrix(c(3,2,5,4),nrow=2)
rownames(bb) <- c("lon","lat")
colnames(bb) <- c('min','max')
as.SpatialPolygons.bbox( bb )

gsk3/taRifx.geo documentation built on May 17, 2019, 8:56 a.m.