raster (version 2.1-41)

intersect: Intersect Extent

Description

Intersect two Extent objects. Returns the intersection, i.e. the area of overlap of two Extent objects. The second argument can also be any argument from which an Extent object can be extracted. If the first object is a Raster* object, this function is equivalent to crop.

Usage

## S3 method for class 'Extent':
intersect(x, y)

## S3 method for class 'Raster':
intersect(x, y)

Arguments

x
Extent or Raster* object
y
Extent object, or any object from which an Extent can be extracted

Value

  • Extent or Raster* object

See Also

union, extent, crop

Examples

Run this code
e1 <- extent(-10, 10, -20, 20)
e2 <- extent(0, 20, -40, 5)
intersect(e1, e2)

Run the code above in your browser using DataLab