Learn R Programming

sampSurf (version 0.7-6)

bboxToPoly: Function to Convert a Valid "bbox" to a “SpatialPolygons” Object

Description

This converts a valid bbox, or object with a bbox specification in the sampSurf package, if available, into a spatial polygon object of class "'>SpatialPolygons".

Usage

bboxToPoly(object, ...)

Arguments

object

Some object with a valid bbox slot from one of the classes in sampSurf, or a valid bbox matrix.

Black hole for everything else.

Value

A "'>SpatialPolygons" object that can be plotted directly.

Details

One can plot the result of this function to quickly get an idea of the overall spatial extent of an object. In many cases the result from this object is the same as that returned by perimeter, but not always; e.g., see the example below.

Examples

Run this code
# NOT RUN {
cp = circularPlot(10, center=c(x=20,y=20))
cp.perim = perimeter(cp)
plot(cp.perim, axes=TRUE, lty='dashed')              #the perimeter of the plot
plot(bboxToPoly(cp.perim), add=TRUE, border='blue')  #the bounding box
# }

Run the code above in your browser using DataLab