write_landclim_maps: Write landClim maps

Description Usage Arguments Author(s) Examples

View source: R/LandClimTools.R

Description

Takes raster stack in the appropiate resolution and writes LandClim maps in the required format.

Usage

1
write_landclim_maps(landClimRasterStack, nodata_value = "-9999", lcResolution = 25, folder)

Arguments

landClimRasterStack
nodata_value

In LandClim often 999. Or another value that should be used.

lcResolution

Cell edge length (e.g. 25)

folder

Path to folder in which files will be written.

Author(s)

Klara Dolos

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
### Create and write LandClim maps ####
require(raster)
gk_projection<-CRS("+init=epsg:31467")
nr <-50
nc <- 50
res <- 40
ex <- extent(0, nc*res, 0, nr*res)
dem <- raster(nrows=nr, ncols=nc, ex)
projection(dem) <- gk_projection
dem
dem[] <- rep(seq(400, 2200,len=nr), each=nc)
x11()
plot(dem)

### Create LandClim map "slope".
slope <- dem
slope[]<- 0

###  LandClim map "soil".
soil <- dem
soil[] <- 20
soil  ### Check min, max values

###  LandClim map "landtype".
landtype <- slope
landtype[] <- 1

### Aspect
aspect <- slope
aspect[] <- 0

###  LandClim map "nitrogen".
nitro <- slope
nitro[] <- 1

### Create raster-stack
maps <- stack(dem, slope, aspect, soil, landtype, nitro)
names(maps) <- c("dem", "slope", "aspect", "soil", "landtype", "nitro")
x11()
plot(maps)

maps25 <- resample_landclim_maps(landClimRasterStack=maps)
res(maps25$dem)

### Write as LandClim files.
write_landclim_maps(landClimRasterStack=maps25, nodata_value="-9999", lcResolution=25)

KDolos/LandClimTools documentation built on March 22, 2018, 2:31 p.m.