Message-ID: <4E81D070.7000605@em.uni-frankfurt.de>
Date: 2011-09-27T13:32:32Z
From: Robert Buitenwerf
Subject: Mask() in raster package only returns RasterLayers not RasterStack or RasterBrick
Dear members,
I am very happily using the raster package but here is a problem I can't
solve.
When I use the mask function on a RasterBrick or RasterStack:
raster_mask <- mask( raster_stack, SpatialPolygonDataFrame)
raster returns a RasterLayer and gives me a warning:
"In .rasterFromRasterFile(grdfile, band = band, objecttype) : size of
values file does not match the number of cells (given the data type)"
When I use mask on a single layer from a brick or stack (e.g. mask(
RasterStack[1], SpatialPolygon*) ) it returns a correctly masked
rasterlayer.
I am trying to mask with a SpatialPolygonDataFrame, read in with
readShapePoly of the maptools package.
R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-mingw32/x64 (64-bit)
I am sure I missed something simple and I hope someone would point it
out to me.
Thanks,
Robert