Description Usage Arguments Details Value See Also Examples
Determine the units in a given spatial data object that intersect with any of the units in another spatial data object.
1 2 3 4 5 6 7 8 9 | intersecting_units(x, y, ...) # x=Raster, y=Raster
intersecting_units(x, y, ...) # x=Spatial, y=Spatial
intersecting_units(x, y, ...) # x=Raster, y=Spatial
intersecting_units(x, y, ...) # x=Spatial, y=Raster
intersecting_units(x, y, ...) # x=data.frame, y=ANY
|
x |
|
y |
|
... |
not used. |
The set_number_of_threads
can be used to distribute
computations among multiple threads and potentially reduce run time.
integer
indices of the units in x
that intersect with
y
.
fast_extract
, set_number_of_threads
,
get_number_of_threads
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## 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
par(mfrow = c(1, 2))
plot(r, main = 'x=Raster')
plot(r_with_holes, main = 'y=Raster')
print(intersecting_units(r, r_with_holes))
## intersect raster with polygons
par(mfrow = c(1, 2))
plot(r, main = 'x=Raster')
plot(ply_with_holes, main = 'y=Spatial')
print(intersecting_units(r, ply_with_holes))
## intersect polygons with raster
par(mfrow = c(1, 2))
plot(ply, main = 'x=Spatial')
plot(r_with_holes, main = 'y=Raster')
print(intersecting_units(ply, r_with_holes))
## intersect polygons with polygons
par(mfrow = c(1, 2))
plot(ply, main = 'x=Spatial')
plot(ply_with_holes, main = 'y=Spatial')
print(intersecting_units(ply, ply_with_holes))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.