-
Notifications
You must be signed in to change notification settings - Fork 0
/
deposition_model_raster.rmd
65 lines (44 loc) · 1.22 KB
/
deposition_model_raster.rmd
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: "raster smoothing"
author: "Jordan Wingenroth"
date: "December 11, 2017"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tiff)
library(raster)
library(rgdal)
library(maps)
library(tidyverse)
library(ggmap)
s1 <- shapefile("data/depo model/conc_sh01.shp")
s2 <- shapefile("data/depo model/conc_sh02.shp")
s3 <- shapefile("data/depo model/conc_sh03.shp")
s5 <- shapefile("data/depo model/conc_sh05.shp")
s6 <- shapefile("data/depo model/conc_sh06.shp")
s9 <- shapefile("data/depo model/conc_sh09.shp")
s10 <- shapefile("data/depo model/conc_sh10.shp")
s11 <- shapefile("data/depo model/conc_sh11.shp")
```
```{r}
farmdata <- readOGR("data/farmdata gis/farmdata.shp")
canvas <- raster(ncol = 200, nrow = 200)
extent(canvas) <- extend(extent(farmdata), .1)
r1<-rasterize(s1, canvas)
r2<-rasterize(s2, canvas)
r3<-rasterize(s3, canvas)
r5<-rasterize(s5, canvas)
r6<-rasterize(s6, canvas)
r9<-rasterize(s9, canvas)
r10<-rasterize(s10, canvas)
r11<-rasterize(s11, canvas)
```
```{r}
s <- stack(c(r1,r2,r3,r5,r6,r9,r10,r11))
sum <- sum(s, na.rm = T)
sum_smooth <- spatialEco::raster.gaussian.smooth(sum, sigma = 4, n = 31)
writeRaster(sum_smooth, "sum_smooth.tif")
```