Description Usage Arguments Examples
Crops a raster file according to a polygon
1 | crop_on_poly(rstr, plgn)
|
rstr |
raster |
plgn |
spatial polygon sp |
1 2 3 4 5 6 7 8 | library(sf)
# download vietnam admin1 administrative map in the internal library and in
# the working direction
vn <- sptools::gadm("vietnam", "sf", 1, intlib = TRUE, save = TRUE)
provinces <- as(vn["VARNAME_1"], "Spatial")
srtm <- srtmVN::getsrtm()
hanoi <- crop_on_poly(srtm, subset(provinces, VARNAME_1 == "Ha Noi"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.