Skip to content

Masked samples inconsistency when there is nodata in hdr file #2829

Answered by sgillies
nmoreaud asked this question in Q&A
Discussion options

You must be logged in to vote

sample's default, for datasets that are all valid (no mask, no nodata value), is to return 0 outside the extent of the dataset.

I've just made a small change to rasterio such that your program produces this:

python /app/test_raster.py
path: bordeaux.bil
detected nodata constant: None
[70] [False]
[97] [False]
[--] [ True]
[--] [ True]
----------------------------
path: bordeaux_nodata.bil
detected nodata constant: 97.0
[70] [False]
[--] [ True]
[--] [ True]
[--] [ True]
----------------------------

For bordeaux.bil. the first [--] [ True] means that the value is outside of the dataset bounds and thus masked. This is what sample intends and advertises and there was a bug.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nmoreaud
Comment options

@sgillies
Comment options

Answer selected by nmoreaud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2828 on May 15, 2023 23:02.