Skip to content
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

Issue with geoviewer.py when loading specific bands #412

Closed
adehecq opened this issue Nov 22, 2023 · 0 comments · Fixed by #418
Closed

Issue with geoviewer.py when loading specific bands #412

adehecq opened this issue Nov 22, 2023 · 0 comments · Fixed by #418
Assignees
Labels
invalid This doesn't seem right

Comments

@adehecq
Copy link
Member

adehecq commented Nov 22, 2023

The argument parser of geoviewer.py is incorrect. For argument "-band" it says: "int, which band to display (start at 0) for multiband images (Default is 0).".
When looking at the code, this argument is passed directly to Raster.show, which has a different behavior:

  • the default is that all bands are displayed, not the first band: for 3 band image, it is shown as RGB (this could be a problem for > 4 band!).
  • if set, the band indexing actually starts at 1.
    The second point also means that if setting "-band 0", the last band is actually displayed, which is confusing!

I suggest the following:

  • update the argument parser of geoviewer.py to be correct
  • possibly, add a condition in Raster.show so that negative values raise an error
@adehecq adehecq added the invalid This doesn't seem right label Nov 22, 2023
adehecq added a commit to adehecq/GeoUtils that referenced this issue Dec 20, 2023
@adehecq adehecq self-assigned this Dec 20, 2023
@adehecq adehecq linked a pull request Dec 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
Development

Successfully merging a pull request may close this issue.

1 participant