Learn R Programming

windfarmGA (version 2.3.0)

getDEM: Get DEM raster

Description

Get a DEM raster for a country based on ISO3 code

Usage

getDEM(polygon, ISO3 = "AUT", clip = TRUE)

Arguments

polygon

A Spatial / SimpleFeature Polygon to crop the DEM

ISO3

The ISO3 code of the country

clip

boolean, indicating if polygon should be cropped. Default is TRUE

Value

A list with the DEM raster, and a SpatialPolygonsDataFrame or NULL if no polygon is given

See Also

Other Helper Functions: dup_coords(), getISO3(), get_grids(), grid_area(), hexa_area(), isSpatial(), permutations(), readintegerSel(), readinteger(), splitAt(), tess2SPdf(), windata_format()

Examples

Run this code
# NOT RUN {
library(sp)
library(raster)
Polygon1 <- Polygon(rbind(c(4488182, 2667172), c(4488182, 2669343),
                          c(4499991, 2669343), c(4499991, 2667172)))
Polygon1 <- Polygons(list(Polygon1), 1);
Polygon1 <- SpatialPolygons(list(Polygon1))
Projection <- "+init=epsg:3035"
proj4string(Polygon1) <- CRS(Projection)
DEM_meter <- getDEM(Polygon1)
plot(DEM_meter[[1]])
plot(DEM_meter[[2]], add=TRUE)
# }

Run the code above in your browser using DataLab