holoviz / holoviz/hvplot

Geo paths cannot be colorized

Open
#792 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

It works for 2 point lines only:

```
df = gpd.GeoDataFrame({'mission': ['A','B']}, geometry=[
shapely.geometry.LineString([(0,0), (1,0)]),
shapely.geometry.LineString([(0,0), (1,1)]),
])
df.hvplot(geo=True, c='mission')
```
image

But it doesn't work for 3+ point lines:
```
df = gpd.GeoDataFrame({'mission': ['A','B']}, geometry=[
shapely.geometry.LineString([(0,0), (1,0), (1,1)]),
shapely.geometry.LineString([(0,0), (1,1), (0,1)]),
])
df.hvplot(geo=True, c='mission')

BokehUserWarning: ColumnDataSource's columns must be of the same length. Current lengths: ('color', 1), ('mission', 4), ('xs', 4), ('ys', 4)
```
image

Sure, in the real life we have longer than 2 point lines and hvplot is broken for them. That looks totally useless to limit line size to just 2 points. Obviously, there is no limitation in Matplotlib:

```
df = gpd.GeoDataFrame({'mission': ['A','B']}, geometry=[
shapely.geometry.LineString([(0,0), (1,0), (1,1)]),
shapely.geometry.LineString([(0,0), (1,1), (0,1)]),
])
df.plot(cmap='jet')
```
image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.