[R-sig-Geo] Overlaying SpatialGridDataFrames over SpatialGridDataFrames?

Edzer Pebesma edzer.pebesma at uni-muenster.de
Thu Apr 12 09:25:30 CEST 2012


does

sPDF_grid <- overlay(as(sGDF_in, "SpatialPointsDataFrame"), sGDF_ref)

work? Until a couple of months ago, this coercion would be automatic.

On 04/12/2012 03:00 AM, Jooil Kim wrote:
> Hello list,  
> 
> I've run into a baffling problem, and I hope someone can help.
> 
> The last few months I have been successfully overlaying a SpatialGridDataFrame object over a SpatialGridDataFrame object. Here's the code I have been using to do this:
> 
>         sPDF_grid <- overlay(sGDF_in, sGDF_ref)
> gridded(sPDF_grid) <- TRUE
> sGDF_grid <- as(sPDF_grid, "SpatialGridDataFrame")
> 
> 
> Today, trying to run this code again, I run into an error telling me that no method exists for overlaying an sGDF object over an sGDF object. This seems true, when I look at the documentation.
> 
> What I have been doing is converting "sGDF_in" to "sGDF_grid", with grid definitions matched to "sGDF_ref". All of the sGDF objects have the same grid sizes (1° x 1°), but are different in the longitude range.
> 
> I'm not exactly sure what change prompted the "overlay" function to start acting differently, let alone why things worked before. I think the code originally came from some examples at a blog or a vignette, but I can't remember anymore.
> 
> I've just tried updating to the latest R version (2.15.0, 64bit) from 2.14.1(I think), and updated to the latest sp packages, but same problems. I'm on Mac (OSX Lion, 10.7.3, 2.26 GHz Intel C2D, 4GB ram).
> 
> Any ideas as to what might be going on?
> 
> Thanks,
> 
> Jooil
> 
> --  
> Jooil Kim
> Postdoc Fellow
> Scripps Institution of Oceanography, UC San Diego
> Mailing address:
> 9500 Gilman Drive # 0244
> La Jolla, CA 92093-0244, USA
> For FedEx/UPS:
> 8675 Discovery Way, Vaughan Hall Rm. 447
> La Jolla, CA 92037, USA
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> 
> 
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics      e.pebesma at wwu.de



More information about the R-sig-Geo mailing list