Raster cropping/masking: mask
Value outside of our area of interest: NA
(could be change with updatevalue
).
srtm_masked = terra::mask(srtm, zion)
plot(srtm_masked, col = grDevices::terrain.colors(50))
plot(zion$geom, add = TRUE)
![](bookclub-geocompr_files/figure-html/unnamed-chunk-107-1.png)
# srtm_inv_masked = mask(srtm, zion, inverse = TRUE)