This examples uses hvplot
on a GeoDataFrame. But the same behavior is observed after converting from the GeoPandas GeoDataFrame to a geoviews Path
or a Spatialpandas
GeoDataFrame.
import geopandas as gpd
import hvplot.pandas
geojson_features = [
{"type": "Feature", "properties": {"id": 19}, "geometry": {"type": "LineString", "coordinates": [[140.51, 4.40], [140.59, 4.33], [140.62, 4.29]]}},
{"type": "Feature", "properties": {"id": 20}, "geometry": {"type": "LineString", "coordinates": [[140.61, 4.39], [140.65, 4.37], [140.69, 4.33]]}}
]
line_gdf = gpd.GeoDataFrame.from_features(geojson_features)
line_gdf
geometry | id | |
---|---|---|
0 | LINESTRING (140.51000 4.40000, 140.59000 4.330... | 19 |
1 | LINESTRING (140.61000 4.39000, 140.65000 4.370... | 20 |
The desired behavior is for the whole line feature (all segments) to be highlighted on hover. Instead, only an individual line segment are highlighted.
line_gdf.hvplot(
geo=True,
color='black',
hover_line_color='red',
tools=['hover'],
hover_cols=['id'],
)
/home/mayorga/miniconda3/envs/flowpilotviz/lib/python3.10/site-packages/geoviews/operation/__init__.py:14: HoloviewsDeprecationWarning: 'ResamplingOperation' is deprecated and will be removed in version 1.18, use 'ResampleOperation2D' instead. from holoviews.operation.datashader import (