我正在尝试使用Goeviews中的Path对象在Jupyter Notebook中可视化一些LINESTRINGS。路径应根据流量的大小进行颜色编码(请参见下面的示例)。我阅读了相关的帖子Displaying Paths with Geoviews,给出的示例对我很有效。
然而,着色似乎不适用于线条。我是不是遗漏了什么?任何帮助都是非常感谢的!
import requests
import geopandas as gpd
import json
import holoviews as hv
import geoviews as gv
hv.extension('bokeh')
url = 'http://stadtplan.bonn.de/geojson?Thema=19584'
r = requests.get(url)
data = r.json()
gdf_traffic = gpd.GeoDataFrame.from_features(data['features'])
gdf_traffic.head(1)
#'geschwindigkeit' = 'traffic' in German
%%opts Path [width=500 height=500 color_index="geschwindigkeit"] (cmap='inferno')
gv.Path(gdf_traffic, vdims=["geschwindigkeit"])发布于 2019-09-30 22:16:15
如果有人还想知道如何给LineStrings上色,这个方法很适合我:
gv.Path(gdf_traffic, vdims["geschwindigkeit"]).opts(opts.Path(color="yellow",line_width=2))https://stackoverflow.com/questions/51853959
复制相似问题