-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Various issues with new Canvas.raster #380
Comments
Looks like merging that PR was premature. @gbrener, will you be able to address these issues on Monday? If not, I guess we should back out those changes for now. |
@philippjfr @jbednar Did the previous implementation of |
No probably not since rasterio datasets are probably quite well defined and consistent, issues 1-4 would probably not have occurred in that case. I'd have to check on the final issue to see if that was handled correctly before, that one is probably the issue that's most difficult to fix. |
@philippjfr The last bullet should now be addressed in PR #389. Please let me know if you have any issues. |
With PR #389 now merged, I am marking this issue closed. |
Currently the newly
Canvas.raster
method for regridding makes several assumption that keep it from being general. Here are the issues I encountered working with it:xarray.DataArray
and work correctly on both. Thedatashader.util.calc_res
function needs to be updated.calc_res
utility also currently assumes that the coordinate arrays are namedx
andy
, which is not a safe assumption to make in general.attrs
inherited from the input array should be optional i.e. this line in Canvas.raster should be conditional in some way:attrs = dict(res=res[0], nodata=source._file_obj.nodata)
yres
ends up negative, resulting in a wrong bounding box. Need to consider flipped coordinates along both axes.To visualize the last issue here's what happens when you try to regrid an image with a bounding box of (-0.5, -0.5, 0.5, 0.5) onto a canvas with a bounding box of (-0.2, -0.2, 0.2, 0.2) this is the result:
i.e. the whole image has been squeezed into the new canvas rather than appropriately excluding samples that fall outside the new bounding box. @gbrener @jbednar
The text was updated successfully, but these errors were encountered: