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

has_mask_band returns true for file with an alpha band #156

Closed
vincentsarago opened this issue Sep 28, 2020 · 0 comments · Fixed by #157
Closed

has_mask_band returns true for file with an alpha band #156

vincentsarago opened this issue Sep 28, 2020 · 0 comments · Fixed by #157

Comments

@vincentsarago
Copy link
Member

import rasterio
from rio_cogeo import utils

with rasterio.open("https://async-cog-reader-test-data.s3.amazonaws.com/201404_13SED190110_201404_0x1500m_CL_1_alpha.tif") as src:
    print(utils.has_alpha_band(src))
    print(utils.has_mask_band(src))
    print(src.mask_flag_enums)
>>> True
>>> True
>>> ([<MaskFlags.per_dataset: 2>, <MaskFlags.alpha: 4>],
 [<MaskFlags.per_dataset: 2>, <MaskFlags.alpha: 4>],
 [<MaskFlags.per_dataset: 2>, <MaskFlags.alpha: 4>],
 [<MaskFlags.all_valid: 1>])

cc @geospatial-jeff

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