Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

In the documentation of sp I saw that the coords argument of the SpatialPolygons function only accepts 2 columns. Is it not possible to create 3-dimensional polygons? I am doing spatio-temporal kriging using package gstat by adding time as a third spatial dimension of a SpatialPointsDataFrame. I would like to extend that to block kriging with polygons as blocks. Is there any way to do that?

share|improve this question

2 Answers 2

You really need to do a bit more research on your methodology and read the documentation to understand the structure of sp S4 class objects and interaction of sp objects with relevant gstat functions. In the sp Vignette there is a detailed explanation of the difference between SpatialPolygons (only polygon topology) and SpatialPolygonDataFrame (polygons with attributes) objects.

What you are explaining is not block Kriging and using time as an attribute does not result in a spatial-temporal estimate. The conceptual methodology you describe is quite invalid. Using polygons or polygon centroids violates the Kriging assumptions of a uniform random field, anisotropy and nonstationarity.

Here is a nice gstat vignette on spatial-temporal models using the interface to the spacetime package. I should also note that the constrainedKriging package can conduct block Kriging on arbitrary shaped blocks using a nonstationary mean function and an isotropic weakly stationary variogram.

That said, to answer your question, you can pass an sp SpatialPointsDataFrame object directly to a variogram/Kriging model in gstat. In this type of sp object, attributes reside in the "data" slot and are already attached to the coordinates via the internal S4 class structure.

# COERCE meuse DATAFRAME TO sp SpatialPointsDataFrame OBJECT
require(gstat)
  data(meuse)
    coordinates(meuse) = ~x+y
      head(meuse@data)

# CREATE SEMIVARIOGRAM USING THE zinc ATTRIBUTE
#   NOTE: THERE IS NO ARGUMENT FOR A "4th DIM"
v <- variogram(log(zinc)~1, meuse)
  plot(v,type="l")
share|improve this answer

Time would be a fourth dimension, z level or height would be the third, tins or dems or z levels handle height in gis, time might be represented by versioned database. you could map the polygon to a tin or intersect with a dem, or associate a z column to the x y columns representing the polygon shape points. Maybe you could add a time field as well with a range of values and value changes through time, incremented as columns. Of course ESRI probably has a tool for that.

share|improve this answer
    
I don't think the Geostatistical Analyst supports space-time kriging. –  Paul Hiemstra Jan 12 '13 at 14:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.