| mc_dtm | R Documentation |
Acquires a Digital Terrain Model from online sources (via the elevatr
package) for the area enclosed by the supplied polygon, and crops it to the
polygon's extent. This replaces the implicit download mechanism of
movecost <= 2.x's studyplot parameter (which remains available in
mc_surface and simply calls this function).
mc_dtm(studyplot, z = 9)
studyplot |
polygon (sf, SpatVector, or legacy sp class) representing the study area for which elevation data are acquired. |
z |
zoom level of the downloaded elevation data (0 to 15; 9 by default). |
The zoom level z controls the resolution of the downloaded data
(default 9, a trade-off between resolution and download time). For details
on the data sources and the ground resolution per zoom level, see the
elevatr documentation:
https://cran.r-project.org/package=elevatr.
Note: the downloaded raster is returned in the CRS provided by the
source. Before using it with mc_surface, make sure it is in a
projected CRS (reproject with terra::project() if needed); a
geographic (lon/lat) raster is rejected by mc_surface() with an
informative error.
A SpatRaster.
mc_surface
## Not run:
# elevation data for the area around Mt Etna (sample polygon in the package)
boundary <- mc_etna_boundary()
dtm <- mc_dtm(boundary, z = 9)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.