Skip to content

Combining Landsat Bands #358

Closed Answered by lnicola
MeechaelA asked this question in Q&A
Jan 1, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

It's because of your index computation. The way you're doing it now, pixels (0, 10) and (10, 0) will map to the same access_point, 10. This causes the diagonal lines -- the diagonals have the same values because they're actually filled with the same pixel.

So here you need to think about the pixel order. Since they're laid out in rows (first row, then the second row etc.), pixel (x, y) will be at y * width + x. Note, though, that some language and libraries will store 2D arrays by columns instead of rows.

Finally, it won't affect the result but, unless the compiler is being very smart, it will be faster if you access the pixels in a sequential pattern. You're looping by x, then by y, whic…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MeechaelA
Comment options

@lnicola
Comment options

@MeechaelA
Comment options

Answer selected by MeechaelA
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