I have a Spatial Point DF spo
(covering an irregular shaped area of interest). The data are not on a regular grid due to CRS transformation.
My goal is a raster with predefined resolution and extent of the area of interest (more spatial point data are to be mapped on this master raster).
Problems start when I
rasterize(spo, raster(ncol, nrow, extent, crs), spo$param)
I need to adjust nrow
and ncol
in a way so that I won't get moire patterns of NAs within my area of interest. I can't use a predefined (higher) resolution.
As a solution to this, I thought I would need some kind of Spatial Pixel DF spi
, that covers my whole area of interest (just like meuse.grid in library(raster); data(meuse.grid)
), and serves as a master grid. Then, I can use it to interpolate my data, e.g.
idw(param~1,spo,spi)
and by this, get full cover of my area of interest at my chosen resolution. But how can a SpatialPixelsDataFrame be produced from the point data?
So in my view, the question boils down to: How to produce meuse.grid from meuse dataset?
Maybe I'm taking the wrong approach here, so please let me know if more easily can achieved what I'm after, using a different way.