georust / gdal

Rust bindings for GDAL
https://crates.io/crates/gdal
MIT License
339 stars 92 forks source link

No iterator support for rasterbands #521

Closed arya-pathak closed 4 months ago

arya-pathak commented 4 months ago

There is no way to use an iterator over the rasterbands of a dataset, the only way to access them is through either indexing using the .rasterband() method, or indirectly specifying a range and iterating over that. For instance: (a..b).into_iter().for_each(|idx| { ds.rasterband(idx); }); Is there any way to do this directly? The dataset layers has a method .layers() that enables iterating over the layers of it. Anything similar for rasterbands would be helpful.

cc: @rkshthrmsh