-
Notifications
You must be signed in to change notification settings - Fork 94
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
Incomplete block pixel iterator #570
Comments
I think we should avoid implementing our own Grid type with iterators and so on. It is to complex and beyond the scope of the crate (my opinion). I know that writing is more complex. If the data is not in C order it needs to be transformed because GDAL uses C order and i think there is no way around it. We could think of a trait for writing that has a &[T] and provides x and y size instead of using the Buffer struct to avoid a copy if you have data already in the perfect shape. |
Just this API, I swear, just this API and we're done 😆. But seriously, we should at least store the actual block size in the buffer so it's easy to access.
I think it supports setting cell (e.g. for pixels with padding) and line strides, plus an initial offset by pointing it to the middle of the buffer. |
This bit me in #556 and probably before: it you read a block at the right or bottom edges of a band, it might be incomplete. In #556 I assumed we'd get a block of smaller dimensions, but GDAL does something different: you get a full block, but only the top-left data is valid (and the extra borders are ignored when writing).
This is hinted at in the GDAL docs:
We could offer a
pixels
(cells. etc.) iterator that only returns the in-bounds values, or we could go full-in onndarray
(see also #569).The text was updated successfully, but these errors were encountered: