New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lingering error from compareGeom gets printed later #1207
Comments
I would use
Your example use of |
I have added a So that you can do
(That does not explain the delayed message) |
Sorry for letting this linger a bit, but I think it works now. I can do
or
Alternatively, you can now use a list as argument (as well as SpatRasterCollections)
|
I admit that the only way I could reproduce this was to copy a weird and potentially inadvisable use case but it is possible it could come up in other situations and was quite tricky to track down.
What happened was I have a list of rasters and a reference raster, they can have different resolution but need to have the same crs and origin. I was using
do.call
to pass the raster list intocompareGeom
and I inlcuded the reference raster (lc
below) twice to cover a case when the list was empty. ThecompareGeom
call returns TRUE and my code continues until awhile later I try to change one of the rasters to a factor and get an error about the resolution. I figured out that this was because there was an error hanging on from thecompareGeom
call in the SpatRaster object.Ideally the error would surface in the
compareGeom
call and then I would at least know that mydo.call
approach was not working and opt for something simpler.My probably better approach that did not return errors was
The text was updated successfully, but these errors were encountered: