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

Raster.set_ndv does not work with multiple nodata values #226

Closed
adehecq opened this issue Jul 7, 2021 · 0 comments · Fixed by #265
Closed

Raster.set_ndv does not work with multiple nodata values #226

adehecq opened this issue Jul 7, 2021 · 0 comments · Fixed by #265
Labels
bug Something isn't working

Comments

@adehecq
Copy link
Member

adehecq commented Jul 7, 2021

Describe the bug
Raster.set_ndv supposedly accept several nodata values, but this hasn't been tested and it fails.
Related to #223 .

To Reproduce

import geoutils as gu
img = gu.Raster(gu.datasets.get_path("landsat_RGB"))
img.set_ndv([2,3, 4])

fails with error

ValueError: Given nodata value, [2, 3, 4], is beyond the valid range of its data type, uint8.

Expected behavior
This should not raise an error.
Apparently, this is not possible to create a raster with several nodata values at the moment with rasterio. This has been raised as an issue: rasterio/rasterio#2234
In the meantime, a quick fix would be to add a NotImplementedError if several nodata values are passed.

System (please complete the following information):
irrelevant

Additional context
None

@adehecq adehecq added the bug Something isn't working label Jul 7, 2021
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.

1 participant