bem_data: Download and load digital elevation data of Berlin

Description Usage Arguments Details Value Examples

View source: R/fetch_dem.R

Description

Download and load digital elevation data of Berlin

Usage

1
2
3
4
5
6
7
bem_data(
  x,
  directory = "BEMdata",
  read = TRUE,
  output_format = "raster",
  merge_output = TRUE
)

Arguments

x

The target area for which dem data are to be downloaded. Either created with bem_target or any object which can be passed to sf::st_bbox

directory

A string giving the path to the directory where downloaded .zip files should be saved to

read

Logical. Should the downloaded data be read into R?

output_format

Character specifying the output format. Default "raster" will return output as raster::`Raster-class`. The alternative is "tbl" which will return a tibble::`tibble-package` of xyz coordinates instead.

merge_output

Logical. If TRUE, all downloaded tiles will be merged in a single object. If FALSE, a list of objects with one entry per tile will be returned

Details

This function will identify targeted tiles of the 1m resolution digital elevation model of Berlin that are distributed by the Geoportal Berlin ("Geoportal Berlin / ATKRIS(R) DGM (1m-Rasterweite)" https://www.govdata.de/dl-de/by-2-0) and download them into a specified directory (default is "BEMdata/"). It will then attempt to load all downloaded data into R and return it in a meaningful format that should make further processing easy.

Value

Either a raster::`Raster-class`, a tibble::`tibble-package` or a list of any of those things, depending on output_format. If read = FALSE, x is returned invisible.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
my_area_of_interest <- bem_target(
xmin = 384000, 
xmax = 386000, 
ymin = 5806000, 
ymax = 5808000)

# Careful! This will kick of ~ 100 MB download!
result <- bem_data(my_area_of_interest)

# In this case the result can be examined e.g. with the help of

# raster::plot(result)

# or

# mapview::mapview(result)
     

## End(Not run)
  
  

Ignimbrit/rbem documentation built on March 13, 2020, 12:02 a.m.