holoviz / geoviews

Simple, concise geographical visualization in Python
http://geoviews.org
BSD 3-Clause "New" or "Revised" License
595 stars 77 forks source link

geoviews Path fails to render #759

Open dwr-psandhu opened 1 week ago

dwr-psandhu commented 1 week ago

ALL software version info

Software Version Info ```plaintext # Name Version Build Channel geoviews 1.13.0 hd8ed1ab_0 conda-forge geoviews-core 1.13.0 pyha770c72_0 conda-forge holoviews 1.19.1 pyhd8ed1ab_0 conda-forge geopandas 1.0.1 pyhd8ed1ab_1 conda-forge geopandas-base 1.0.1 pyha770c72_1 conda-forge ```

Should render but fails with error

Conversation started on discourse https://discourse.holoviz.org/t/error-for-geoviews-path/8362/1

Complete, minimal, self-contained example code that reproduces the issue

# %%
import geopandas as gpd
import geoviews as gv

gv.extension("bokeh")
import cartopy.crs as ccrs

# %%
gdf = gpd.read_file("some_channels.geojson")
# %%
gv.Path(gdf).opts(width=400, height=500)

The data file is used is here

Stack traceback and/or browser JavaScript console output

geoviews\data\geopandas.py:517, in GeoPandasInterface.split(cls, dataset, start, end, datatype, **kwargs)
    514 gt = geom_type or get_geom_type(geom)
    516 arr = geom_to_array(geom)
--> 517 d = {xdim.name: arr[:, 0], ydim.name: arr[:, 1]}
    518 d.update({vd.name: row[vd.name] for vd in dataset.vdims})
    519 ds.data = [d]

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
holovizbot commented 1 week ago

This issue has been mentioned on HoloViz Discourse. There might be relevant details there:

https://discourse.holoviz.org/t/error-for-geoviews-path/8362/4