Skip to content

shapefile errors and kriging limits

2 messages · Carlos Guerra, Roger Bivand

#
On Thu, 30 Aug 2007, Carlos Guerra wrote:

            
Without the error messages and the output of sessionInfo(), it isn't easy 
to say.
Although you are free to use the shapefiles package, your questions 
suggest that you might be better served by using sp classes and either 
maptools or rgdal to read and write your files. If you read the points 
data with readOGR() or readShapePoints(), created a GridTopology for your 
grid, and used the overlay() method from sp to cookie-cut the grid with a 
SpatialPolygonsDataFrame object read by readShapePoly() or readOGR(), and 
then simply passed coordinates() of the SpatialPixelsDataFrame object 
created after the overlaying to the loc= argument, you would be very 
close. Use bbox() of the imported SpatialPointsDataFrame object to find 
out what the grid should be. Consider reading the vignette of the sp 
package - and finally just output the SpatialPixelsDataFrame augmented 
with the prediction as a new column as a GeoTiff file using writeGDAL() in 
rgdal, choosing only the predictions.

There are a number of steps to take, but it does work.

Hope this helps,

Roger