get_dem | R Documentation |
amazon web services provide access to SpatRaster elevations. This function provides access to the Registry of Open Data on AWS to retrieve a raster object of elevations.
get_dem(r = NA, lat, long, resolution = 30, zmin = 0, xdims = 200, ydims = 200)
r |
optional SpatRaster object covering the location for which elevations are required |
lat |
the latitude (in decimal degrees) of the location for which elevations
are required. Not used if |
long |
the longitude (in decimal degrees) of the location for which elevations
are required. Not used if |
resolution |
the resolution (in metres) of the required dem (see details). |
zmin |
assumed sea-level height. Values below this are set to zmin. |
xdims |
optional numeric value specifying the number of longitudinal grid cells |
ydims |
optional numeric value specifying the number of latitudinal grid cells |
Currently, get_dem
utilises the Amazon Web Services (AWS)
(https://aws.amazon.com/public-datasets/terrain/) to retrieve dems. The spatial
resolution of the data available vary by location
(see https://mapzen.com/documentation/terrain-tiles/data-sources/ for details
and https://github.com/tilezen/joerd/blob/master/docs/images/footprints-preview.png
for a map showing the resolution of data available for different parts of the globe).
Global coverage is ~30m resolution and if the resolution of data requested is
higher than that available, elevations are derived by interpolation. If r
is
unspecified, then lat
and long
are used to retrieve a xdims x ydims cell raster
centred on lat
and long
. Bathymetry is also returned automatically form AWS,
so zmin
allows the user to specify a sea-level height. Elevations below zmin
are set at zmin
. For use with microclima
the returned raster has a Mercator
Coordinate Reference System if the latitude specified by lat
is between 80
degrees S and 84 degrees N. In polar regions WGS 84 / NSIDC Sea Ice Polar
Stereographic projections are used. X, y and Z units are all in metres. If r
is
specified, the Coordinate Reference System of r
is used.
a SpatRaster object of elevations in metres.
library(terra)
dem50m <- get_dem(rast(dtm100m), resolution = 50)
plot(dem50m) # 50m raster, OSGB projection system
dem5m <- get_dem(lat = 49.97, long = -5.22, resolution = 5)
plot(dem5m) # 5m raster, Mercator projection system # warning given
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.