我正在尝试使用hydrostm 和hydrokrige 使用带有外部漂移的克里金法。虽然,试图插值,我不能很好地插值。我正在使用 dem 30 m 数据。代码如下:
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)