[Gdal-dev] Nodata bitmasks / null processing

Ray Gardener rayg at daylongraphics.com
Sun Aug 5 15:26:09 EDT 2007


I think option 3 is good, it's similar in design to the boolean array 
returned when projecting a list of coordinates and invalid projections 
have to be individually identified. I'm partial to a new band method to 
read/write void masks.

Option 2 could work too. Writing is a little funky... you'd set an 8-bit 
band type but a nodata value of 256, and the driver would see if it 
could write void masks. But the amount of extra coding doesn't seem great.

Reading is the bigger problem. e.g., caller-side code to tell what bit 
depth an image is would likely fail. It's not symmetrical with writing. 
You'd need an extra band method indicating what the real physical bit 
depth was. Since callers have to account for possible differences in 
physical and logical depth, may as well cut to the chase and do option 
3. It might still be tempting since a logical depth method is less work, 
but it feels like a hack.

My two cents,
Ray



More information about the Gdal-dev mailing list