You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was unable to use merge() with 3-band images until I added a third dimension to the shape expression in union(): shape = (np.abs(np.floor((latmax-latmin)/rasters[0].y_cell_size)).astype(int), np.floor((lonmax-lonmin)/rasters[0].x_cell_size).astype(int), 3)
Was I using merge() incorrectly or does there need to be a test for the number of bands in the input imagery?
The text was updated successfully, but these errors were encountered:
The code is not optimized for multi band rasters, since I never use those. But it shouldn't be too difficult to extend functionality I think. Would you mind sharing the raster you are using? Could you also let me know which functions or properties you have encountered problems with? Perhaps one way forward is to allow the choice of band to import. Then every band will be its own georaster. Additionally it would be possible to create a new object for multi band georasters.
Unfortunately, I can't share the data. When I have time (could be a while) I'll try to reproduce with some other data.
Only on merge()/union() so far. I will add to this log any others that appear to have a similar problem.
Observation:
When using from_file() the image is loaded with the bands/channels in the first dimension/axis. In my data, because I'm converting from an array, the channels are in the 3rd dimension. Therefore, the above code snippet will not work in every case - and it will definitely break if the image does not have 3 bands (it was a brute-force fix).
I would be happy to propose a an update to union() that would work for single or multi-band imagery. It would be useful to know if there is any functionality in georasters that assumes the axis in which the channels sit. Would it be possible to update the GeoRaster class with an attribute stating the channel axis (e.g. channel_axis=0)?
I was unable to use merge() with 3-band images until I added a third dimension to the shape expression in union():
shape = (np.abs(np.floor((latmax-latmin)/rasters[0].y_cell_size)).astype(int), np.floor((lonmax-lonmin)/rasters[0].x_cell_size).astype(int), 3)
Was I using merge() incorrectly or does there need to be a test for the number of bands in the input imagery?
The text was updated successfully, but these errors were encountered: