Interpolation using Kriging with external drift using hydroSTM

#I am trying to use kriging with external drift using hydrostm and hydrokrige. While, trying to interpolate, I can not interpolate well. I am using dem 30 m data. The code is following below with files in attachment.


R<- library(zoo)
library(hydroTSM)
library(xts)
library(sp)
library(automap)
library(gstat)
library(sp)
library(rgdal)
library(raster)
bena.ts<- read.csv("EbroPPtsDaily.csv")
bena.gis = read.csv("EbroPPgis.csv")
bena.rs <- raster("DEM-UTM.tif")
bena.sa = readOGR("subBASIN-UTM.shp")

Covert Raster to spatial grid data frame

y <- as(bena.rs, "SpatialGridDataFrame")
class(y)

Make Projection according to study area

p4s <- CRS("+proj=utm +zone=43 +datum=WGS84 +units=m +no_defs +ellps=WGS84
+towgs84=0,0,0")
bena.ts1 <- as.numeric(bena.ts[180, 2:ncol(bena.ts)])
names(bena.ts1) = colnames(bena.ts[180,2:ncol(bena.ts)])

Computing OK, over the spatial grid defined by the DEM

Not run:

x.ok <- hydrokrige(x.ts= bena.ts1, x.gis=bena.gis,
X="EAST_ED50", Y="NORTH_ED50", sname="ID",
formula=value~1,
subcatchments= bena.sa,
p4s= p4s,
predictors=y,
ColorRamp= "Precipitation",
main= "OK Precipitation on the Ebro",
arrow.plot= TRUE,
arrow.offset= c(900000,4750000), arrow.scale= 20000,
scalebar.plot= TRUE,
sb.offset= c(400000,4480000), sb.scale= 100000)

Hello, please replace all screenshots with plain text information where possible.
Also when writing code to the forum add a line with only triple backticks to make the code format correctly, you then end the code section with a line of onyly triple backticks again. triple backticks look like ```

code example
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.