raster (version 1.0.4)

intersectExtent: Extent intersection

Description

intersectExtent returns the intersection (i.e. the area in which they all overlap) of multiple Extent objects

Usage

intersectExtent(x, ..., validate=TRUE)

Arguments

x
Extent object or object from which it can be coerced via extent (Raster* or Spatial* objects)
...
Additional Extent or Raster* or Spatial* objects
validate
Logical. If TRUE, an error is returned if the intersection is empty; else NULL is returned if the intersection is empty

Value

  • Extent object

See Also

unionExtent, extent

Examples

Run this code
r <- raster()
b1 <- extent(-10, 10, -20, 20)
b2 <- extent(0, 20, -40, 5)
i <- intersectExtent(b1, b2)

Run the code above in your browser using DataCamp Workspace