bboxSpatialPolygon: Convert a bounding box to a SpatialPolygons object Bounding...

View source: R/bboxSpatialPolygon.R

bboxSpatialPolygonR Documentation

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(boundingbox, proj4stringFrom = NULL, proj4stringTo = NULL)

Arguments

boundingbox

Bounding box: a 2x2 numerical matrix of lat/lon coordinates

proj4stringFrom

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

proj4stringTo

Projection string, or NULL to not project

Value

A SpatialPolygons object of the bounding box

References

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

Examples

## Not run: 
boundingbox <- terra::ext(-180, +180, -50, +50)
bbSP <- bboxSpatialPolygon(boundingbox = boundingbox)

## End(Not run)


ropensci/hddtools documentation built on July 24, 2022, 6:29 p.m.