Learn R Programming

hddtools (version 0.3.0)

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

Description

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

Usage

bboxSpatialPolygon(bbox, proj4stringFrom = NULL, proj4stringTo = NULL)

Arguments

bbox
Bounding box: a 2x2 numerical matrix of lat/lon coordinates
proj4stringFrom
Projection string for the current bbox coordinates (defaults to lat/lon, WGS84)
proj4stringTo
Projection string, or NULL to not project

Value

A SpatialPolygons object of the bounding box

References

http://gis.stackexchange.com/questions/46954/clip-spatial-object-to-bounding-box-in-r

Examples

Run this code
## Not run: 
#   bbox <- list(lonMin=-180,latMin=-50,lonMax=+180,latMax=+50)
#   bbSP <- bboxSpatialPolygon(bbox)
# ## End(Not run)

Run the code above in your browser using DataLab