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

Fix issues in from_array #282

Closed
2 tasks
adehecq opened this issue Aug 26, 2022 · 3 comments · Fixed by #289
Closed
2 tasks

Fix issues in from_array #282

adehecq opened this issue Aug 26, 2022 · 3 comments · Fixed by #289
Labels
bug Something isn't working

Comments

@adehecq
Copy link
Member

adehecq commented Aug 26, 2022

Despite our best efforts, PR #265 seems to have introduced bugs that are not caught by current tests.
The backbone is in from_array and some checks seem to have been lost in the PR after this line, e.g.:

  • the dimension of data is not forced to be 3D (as in rasterio)
  • the mask is likely not always preserved
@adehecq adehecq added the bug Something isn't working label Aug 26, 2022
@rhugonnet
Copy link
Contributor

Also potentially after this line of _update, that doesn't exist anymore.

@adehecq
Copy link
Member Author

adehecq commented Aug 26, 2022

Actually, the issue does not seem to be in from_array, or at least I was not able to find one. But an issue occurs with reproject for rasters with masked values, e.g.:

import geoutils as gu
# Take any raster with gaps
r = gu.Raster('/Users/adehecq/work/RAGMAC/ragmac_xdem/data/raw/experiment_2/PK_Baltoro/DEM_2002.75631975.tif')
r2 = r.reproject(dst_res=20)
print(r2.data)
print(r.data)

-> r2.data and r.data have different fill_value. This might cause issues later.

@rhugonnet
Copy link
Contributor

Maybe the added lines in reproject here?
More tomorrow...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants