We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17f6b04 commit 8b99213Copy full SHA for 8b99213
xrspatial/utils.py
100644
100755
@@ -86,12 +86,9 @@ def calc_res(raster):
86
87
def get_dataarray_resolution(agg: xr.DataArray):
88
89
- if not agg.attrs.get('res'):
90
- raise ValueError('input xarray must have `res` attr.')
91
-
92
# get cellsize out from 'res' attribute
93
cellsize = agg.attrs.get('res')
94
- if isinstance(cellsize, tuple) and len(cellsize) == 2 \
+ if isinstance(cellsize, (tuple, np.ndarray, list)) and len(cellsize) == 2 \
95
and isinstance(cellsize[0], (int, float)) \
96
and isinstance(cellsize[1], (int, float)):
97
cellsize_x, cellsize_y = cellsize
0 commit comments