Learn R Programming

IsoriX (version 0.7)

ElevRasterDE: The raster of elevation for Germany

Description

This raster contains the elevation of the surface of Germany [meters above sea level] with a resolution of approximately 50 square-km.

Arguments

Format

A RasterLayer

Details

This raster contains elevation data of Germany in a highly aggregated form corresponding to a resolution of approximately one elevation value per 50 square-km. This is only for the purpose of having a small and easy-to-handle file to practice, but it should not be used to perform real assignments!

In the example below, we show how we generated this small raster from a large original DEM (digital elevation model) of the entire world. The original raster has a resolution of approximately one elevation value per square-km (cell size of 30 arcseconds, i.e. 0.0083 decimal degrees). Although working on large rasters is technically problematic (memory and CPU greedy), we highly recommend to rely on high-resolution rasters with small to moderate aggregation levels in order to perform reliable assignment analyses. Indeed, large aggregation of raster cells can bias assignments due to the transformation of all elevations into a single value per aggregated raster cell.

We downloaded "Global Multi-resolution Terrain Elevation Data 2010" from: http://topotools.cr.usgs.gov/gmted_viewer/ and converted it into a tif file. Because the original file is very large, we directly provide the url link of the tif file in the example below.

See Also

relevate to crop and/or aggregate the elevation raster

Examples

Run this code
# NOT RUN {

## The following example require to have downloaded
## a large elevation raster with the function getelev()
## and will therefore not run unless you type:
## example(ElevRasterDE, run.dontrun=TRUE)

# }
# NOT RUN {
### Creating the object ElevRasterDE

## Download the tif file (ca. 700 Mb)
## (see ?getelev for details on how to get the tif file)
# getelev()

## Convert the tif into R raster format
if(require(raster)) {
  elevationrasterbig <- raster("gmted2010_30mn.tif")
  
  ## Create the highly agregated elevation raster
  ElevRasterDE <- relevate(elevationrasterbig,
                           aggregation.factor = 10,
                           manual.crop = c(5.5, 15.5, 47, 55.5))
                           
  ## Plot the elevation
  if (require("sp") & require("rasterVis")) {
    levelplot(ElevRasterDE, margin = FALSE, par.settings=RdBuTheme()) +
      layer(sp.polygons(CountryBorders, col = "white"))
  }
  
  ## Compute crudely the resolution:
  median(values(area(ElevRasterDE)))  ## approximative size of cells in km2
}
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab