Closed Kodiologist closed 11 months ago
The error message could be more helpful. Here's the definition of "compatible" from the README:
The weighting raster must use the same coordinate system as the primary raster, and it must use a grid that is compatible with the primary raster. (The resolutions and extents of the rasters need not be the same, but the higher resolution must must be an integer multiple of the lower resolution, and the cell boundaries of both rasters must coincide with cell boundaries in the higher-resolution grid.)
I see. I missed that. I guess using the GPW raster directly as weights isn't an option for value rasters that are on a grid too different from that of GPW, at least without regridding one or the other. Thanks.
Here's my attempt at a simple example in the style of
vig1_population
:The result is
Error in CPP_stats(x, weights, wkb, default_value, default_weight, coverage_area, : Incompatible extents.
. Why are the extents incompatible? I'm not sure if I'm doing something wrong or there's a bug. I tried croppingpop.density
, since the GPW raster in the vignette is cropped, but the error persisted. I started out usingterra
rather thanraster
, but switching toraster
didn't help.I'm using
exactextractr
0.8.2,sf
1.0.7, andraster
3.5.15 on R 4.1.2.