Find which of the units in a spatial data object intersect with the units in another spatial data object.
# S4 method for Raster,Raster intersecting_units(x, y) # S4 method for Spatial,Spatial intersecting_units(x, y) # S4 method for Raster,Spatial intersecting_units(x, y) # S4 method for Spatial,Raster intersecting_units(x, y) # S4 method for data.frame,ANY intersecting_units(x, y)
x 


y 

integer
indices of the units in x
that intersect with
y
.
The set_number_of_threads
can be used to distribute
computations among multiple threads and potentially reduce run time.
# create data r < raster(matrix(1:9, byrow = TRUE, ncol=3)) r_with_holes < r r_with_holes[c(1, 5, 9)] < NA ply < rasterToPolygons(r) ply_with_holes < rasterToPolygons(r_with_holes) # intersect raster with raster#> [1] 2 3 4 6 7 8# intersect raster with polygons#> [1] 2 3 4 6 7 8# intersect polygons with raster#> [1] 2 3 4 6 7 8# intersect polygons with polygons#> [1] 2 3 4 6 7 8