3

I am trying to do automatic mapping. I want to have a uncertainty map , which uncertainties are displayed by isolines. I want to export these isolines and the values associated with them and then display them through web map service. Is it possible? by following code you can produce the contour lines

require(gstat)
require(lattice)
data(meuse)
data(meuse.grid)
coordinates(meuse) = ~x+y
gridded(meuse.grid) = ~x+y
m <- vgm(.59, "Sph", 874, .04)
# ordinary kriging:
x <- krige(log(zinc)~1, meuse, meuse.grid, model = m)
l=as.data.frame(x)
contourplot(var1.var ~ x+y,data=l,cuts=10)

1 Answers1

1

This is not a direct answer for your question, but maybe it can point you in the right direction:

you can generate an object from your contourplot

CP<- contourplot(var1.var ~ x+y,data=l,cuts=10)

And try to look at its structure

fix(CP)

The data about isolines is stored here:

x <- CP$panel.args.common[1]$x
y <- CP$panel.args.common[2]$y
z <- CP$panel.args.common[3]$z

But I cannot figure out now how to extract it. Maybe this can help you a bit.