Learn R Programming

windfarmGA (version 2.2.3)

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 <- "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
proj4string(Polygon1) <- CRS(Projection)
DEM_meter <- getDEM(Polygon1)
plot(DEM_meter[[1]])
plot(DEM_meter[[2]], add=T)
# }

Run the code above in your browser using DataLab