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

Support for Multi-band rasters #58

Open
ozak opened this issue May 28, 2020 · 10 comments
Open

Support for Multi-band rasters #58

ozak opened this issue May 28, 2020 · 10 comments

Comments

@ozak
Copy link
Owner

ozak commented May 28, 2020

Seems it would be useful to handle multi-band rasters. May need first to move to rasterio and then a rethink on how to handle and change functions accordingly. Should resolve issues #26, #39, #54.

@snowman2
Copy link

snowman2 commented Oct 5, 2020

I wonder if rioxarray might help with the transition?

https://github.com/corteva/rioxarray

@ozak
Copy link
Owner Author

ozak commented Oct 7, 2020

Looks like an interesting project. Seems there is some overlap between what this package does and that one.

@snowman2
Copy link

snowman2 commented Oct 8, 2020

They do attempt to solve similar problems. I was thinking it might simplify the transition to use rasterio. Also, it uses Xarray, which I also thought might be useful for solving the multi-band/multi-subdataset support.

@pessimo
Copy link

pessimo commented Sep 7, 2021

just found that georasters.from_file gave the wrong meta info when handling multi-band raster file, maybe currently we should raise exception?

in my case, read a 3 bands(rgb) raster file gave wrong xmin, xmax, so shape of raster file was (3, 256) instead of (3, 256, 256)

@ozak
Copy link
Owner Author

ozak commented Sep 7, 2021

Indeed that is a major issue right now. No multilayer support. I do not think it should be difficult to add a flag to select band for importing once the move to rasterio has been done. I just have not had the time. Does anyone want to try to tackle this? Help would be greatly appreciated.

@volkanyazici
Copy link

In my study, I work with 12 bands. When I tried to read tif file as pandas dataframe with the code df = data.to_pandas() I get an error like this ValueError: Must pass 2-d input. shape=(12, 1257, 1065). And then I found this issue. So, can you tell if there is a multi-band support yet? Thanks.

@ozak
Copy link
Owner Author

ozak commented Mar 22, 2022

Sorry not yet. I haven't had the time to do this. It may need quite a bit of rewriting of the whole package to ensure things are being computed the right way. It's one of the issues where help would be more than welcome.

@volkanyazici
Copy link

I would like to point out that since I am new to python, I am not qualified to edit the codes. I hope someone will spare their help to improve this beautiful package.

@shelleyg-bit
Copy link

I would love to work on this feature. I have been looking to contribute to open source, this seems just the right amount of challenge. I came here because I wanted to analyze a multi-band raster using pandas.

@ozak
Copy link
Owner Author

ozak commented Apr 23, 2022

Thanks @shelleyg-bit That would be great! I think the way to tackle this will need us to first move the import to rasterio which will allow importing one or more bands. Then I think it's just deciding whether to create a new MB ie multi-band class or change the code to ensure that things works fine. My own preference would be to create a new MB class. Do you want to start a new branch for the rasterio changes first. Then we can try this part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants