I want to do kriging with external drift(universal kriging) in R. The covariate I use is in WGS84 refrence system. Because of nature of kriging which calculates distance in planar surface I have to do transformation from WGS84 to ETRS89. what I want out of kriging is a raster map. Because of the reference system transformation the prediction points are not regular grids and what I get as a result is a vector map.

Air pollution map using covariate on irregular gird

I used 'gstat' package in and spplot() function to create plots. But When grids are regular (wich I can not define because of nature of the covariate data) with equal distance I have a raster map.

migrated from stackoverflow.com Jan 6 '13 at 3:01

This question came from our site for professional and enthusiast programmers.

  • You assume that people here are familiar with geostatistical tools/jagon, maybe you can try to simplify your question. Is the question , how to coerce/convert a "Vector map" to a "raster map"? Also can you give us some reproducible example of what you have tried..at least kiriging code. – agstudy Jan 5 '13 at 12:03
  • Flagged for migration to gis.SE – Ari B. Friedman Jan 5 '13 at 12:20
  • An alternate venue besides GIS.SE would be the R-SIG-geo mailing list, but you should wait a day or two because cross-posting to the R mailing lists is deprecated. – DWin Jan 5 '13 at 19:06
  • Could you please update your post with a specific question? Also, it would be helpful if you posted your code. – Aaron Jan 6 '13 at 4:19
  • Like others, I'm not sure about your actual question, but try consulting the Pratical Guide to Geostatistic, One of the chapters, give a nice explanation of to preform a krigging using R – Alexandre Neto Jan 6 '13 at 5:01


  • generate a regular grid of points in the lat-long coordinate system, transform to ETRS89 using spTransform, and plug those points into whatever kriging package you are using (you don't say, you don't give examples), get the estimates, and back-transform with spTransform to lat-long.

  • do your kriging in a regular grid in your ETRS89 system, then convert the output to a raster package object, then warp the raster to lat-long.

I'd prefer the first option, and I'd convert the output to a raster package object as well.

  • I exactly did the first option that you mentioned and get the result as attached image.. the second approch is not possible because of the nature of kriging which calculates distance in planar surface e.g. meters or kilometers. what I did to solve the problem is to do interpolation for the covariates and get the covariates values on regular grids and then use these estimates. I think I kind of did resampling. However, interpolated values contain error. – Mona Eshraghi Jan 6 '13 at 15:36
  • 2
    If you did the first thing, then how come your results in your plot aren't on a regular lat-long grid? Actually, you've not told us either what package and functions you used to compute the kriging estimates, or what coordinate system that plot is. Please update your question with some more information. – Spacedman Jan 6 '13 at 15:54
  • because when I trasform lat/log system to ETRS89,it gives me coordinates in meters and grids are not rectangular anymore. – Mona Eshraghi Jan 7 '13 at 9:26
  • 2
    Lets try once more, then I give up: Create a regular grid in lat-long. Convert to ETRS89 locations, you now have an irregular grid. Do your kriging using those locations as your prediction locations. Now reverse the transform to get a regular grid in lat-long. – Spacedman Jan 7 '13 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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