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 think we should support both formats, read through vanilla xarray and with rioxarray loaded in the session too. The former is a more generic approach, the latter is a more robust one for rasters.
Not sure what'd be the ideal way of supporting this. I'm cc'ing here @MgeeeeK since he worked on the original implementation and might have some ideas, and @snowman2 as the main driver behind rioxarray in case they have some suggestions in terms of best practices.
The text was updated successfully, but these errors were encountered:
I've issued a PR (#455 ) that I think should have a more comprehensive approach following @snowman2 suggestion from rioxarray. If tests pass, I think it should be good to merge.
The
raster
functionality in for weights building currently supportsDataArray
objects created throughxarray.open_rasterio
:The code above correctly picks up that missing data are specified with -200 and removes them from the calculation of the weights:
This is not the case when we use
DataArray
objects build through the (generally recommended)rioxarray.open_rasterio
:which does not pick up the missing data:
My hunch is that this is because the builder picks up missing values only through the
attrs
object:libpysal/libpysal/weights/raster.py
Lines 229 to 233 in 0f03a31
But
rioxarray
does not populate that general object, instead logs missing data underpop2.rio.nodata
:I think we should support both formats, read through vanilla
xarray
and withrioxarray
loaded in the session too. The former is a more generic approach, the latter is a more robust one for rasters.Not sure what'd be the ideal way of supporting this. I'm cc'ing here @MgeeeeK since he worked on the original implementation and might have some ideas, and @snowman2 as the main driver behind
rioxarray
in case they have some suggestions in terms of best practices.The text was updated successfully, but these errors were encountered: