Hi,
I'm trying to extract data from the Europe CORINE land cover raster.
r
class : RasterLayer
dimensions : 46000, 59000, 2.714e+09 (nrow, ncol, ncell)
resolution : 100, 100 (x, y)
extent : 1500000, 7400000, 9e+05, 5500000 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
data source : C:\Users\samf\Documents\Git\cuckoos\data\corine raster
100x100\g100_06.tif
names : g100_06
values : 0, 255 (min, max)
I have 3 spatial polygons for which I want to extract raster values.
randomstop
class : SpatialPolygons
features : 3
extent : 2997503, 3946661, 1857532, 3090567 (xmin, xmax, ymin, ymax)
coord. ref. : +init=epsg:3035 +proj=laea +lat_0=52 +lon_0=10 +x_0=4321000
+y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
When I try to extract, I get the following error message:
extract(r, randomstop)
Error in .readCellsGDAL(x, uniquecells, layers) :
NAs are not allowed in subscripted assignments
I have extracted each polygon separately, and I know which one is causing
the error. When I create a new raster using crop() to the same extent as
the problem polygon, it extracts fine. Also, when I crop r to the extent of
randomstop (all 3 polygons), it also extracts fine. But there doesn't seem
to be an obvious problem with the extent of r in relation to the extent of
randomstop.