Skip to content
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

Change get_data_in_grid return value when no data in grid #17

Closed
jflowernet opened this issue Apr 5, 2024 · 0 comments · Fixed by #20
Closed

Change get_data_in_grid return value when no data in grid #17

jflowernet opened this issue Apr 5, 2024 · 0 comments · Fixed by #20

Comments

@jflowernet
Copy link
Member

jflowernet commented Apr 5, 2024

At the moment get_data_in_grid errors with a message when a spatial grid has no data within it. This creates problems when looping over data to be gridded as it stops the loop. For sf grids, @jase would like the spatial grid that was input returned unchanged, with just a message saying there is no data.
For raster grids, I think it should either return an NA raster or NULL - perhaps the former since if stacking results of many calls to get_data_in_grid, could then filter out NAs with stack[[!is.na(terra::global(stack, min)[[1]])]]

Will fix emlab-ucsb/oceandatr#41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant