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
Minimal example run with the following config, but encountered this issue in other environments:
geoviews 1.9.1
holoviews 1.14.5
bokeh 2.3.3
datashader 0.13.0
cartopy 0.18.0
python 3.9.7
jupyter and bokeh server
CentOS 7 / RHEL 7 / Ubuntu 18.04
Description of expected behavior and the observed behavior
In contrast to hv.RGB, gv.RGB only takes input arrays with shape NxMx4. Sending a NxMx3 array will raise an error at rendering, while the docstrings states that "[An] input array may have a shape of NxMx4 or NxMx3. In the latter case, the defined alpha dimension parameter is appended to the list of value dimensions."
Complete, minimal, self-contained example code that reproduces the issue
importnumpyasnpimportgeoviewsasgvimportcartopy.crsasccrsgv.extension('bokeh')
img=np.array(np.zeros((100, 100, 3)))
coastline=gv.feature.coastlinergb=gv.RGB(img, bounds=(-10, -10, 10, 10), crs=ccrs.PlateCarree()))
# When trying to render the following (in a notebook or bokeh server), an error will be issued
(rgb*coastline).opts(projection=ccrs.PlateCarree(), width=600, height=300)
~/miniconda3/envs/jupyter/lib/python3.9/site-packages/holoviews/core/data/image.py in values(cls, dataset, dim, expanded, flat, compute, keep_index)
197 # than expanded column format, reorient before expanding
198 if dataset.data.ndim > 2:
--> 199 data = dataset.data[:, :, dim_idx-dataset.ndims]
200 else:
201 data = dataset.data
IndexError: index 3 is out of bounds for axis 2 with size 3
The text was updated successfully, but these errors were encountered:
TheoMathurin
changed the title
Issues with gv.RGB
gv.RGB does not work with NxMx3 arrays
Sep 10, 2021
ALL software version info
Minimal example run with the following config, but encountered this issue in other environments:
Description of expected behavior and the observed behavior
In contrast to
hv.RGB
,gv.RGB
only takes input arrays with shape NxMx4. Sending a NxMx3 array will raise an error at rendering, while the docstrings states that "[An] input array may have a shape of NxMx4 or NxMx3. In the latter case, the defined alpha dimension parameter is appended to the list of value dimensions."Complete, minimal, self-contained example code that reproduces the issue
Stack traceback and/or browser JavaScript console output
Last element of traceback:
The text was updated successfully, but these errors were encountered: