[R-sig-Geo] Error when trying to extract values for points in a SpatialPointsDataFrame

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Sep 18 11:20:34 CEST 2012


On Tue, Sep 18, 2012 at 9:19 AM, Emmenegger Tamara
<Tamara.Emmenegger at vogelwarte.ch> wrote:
> Dear mailing list members,
>
> I'd like to extract raster values for the points in a SpatialPointsDataFrame.
>
>
> raster::extract(rasterlayer,spdf[x,],method='simple')
>
> But I get the error message:
>
>
> Fehler in .local(x, ...) :
>
>   kein Slot des Namens "blockrows" für dieses Objekt der Klasse ".RasterFile"
>
> Unfortunately I am unable to make head or tail of it. Any ideas what is going wrong?

 Hard to tell without knowing where your 'rasterlayer' object has come
from or what version of raster you are using or a basic knowledge of
German...

 If I create a raster object from a file and run str() on it, one of
the slots is of class .RasterFile and has a slot called 'blockrows':

> str(r)
Formal class 'RasterLayer' [package "raster"] with 16 slots
  ..@ file      :Formal class '.RasterFile' [package "raster"] with 11 slots
  .. .. ..@ name        : chr
"/data/rowlings/Datasets/eea.europa.eu/CorineLandCover/cumbria.tif"
  .. .. ..@ datanotation: chr "INT1U"
  .. .. ..@ byteorder   : chr "little"
  .. .. ..@ nodatavalue : num -Inf
  .. .. ..@ nbands      : int 1
  .. .. ..@ bandorder   : chr "BIL"
  .. .. ..@ offset      : int 0
  .. .. ..@ toptobottom : logi TRUE
  .. .. ..@ blockrows   : int 28
  .. .. ..@ blockcols   : int 285
  .. .. ..@ driver      : chr "gdal"

Somehow you have created something that doesn't have this... Where did
it come from?

Barry



More information about the R-sig-Geo mailing list