【发布时间】:2021-12-02 21:43:09
【问题描述】:
当我尝试绘制 Postgis 线串时,感谢 gv.Path() 或 hvplot(geo=True),我有这个错误:Supplied data does not contain specified dimensions, the following dimensions were not found: ['Longitude', 'Latitude']。
sqla="Select Geography(ST_transform(traja,4326)) as traja, namea,nameb,mmsia,mmsib,p_dist,cpa_id from filtered where nm_a is not null and geometrytype(traja)='LINESTRING' limit 10"
gdf=gpd.read_postgis(sqla,con,geom_col='traja')
gdf.head()
type(gdf['traja'][0])
----------------
shapely.geometry.linestring.LineString
当我尝试可视化时:
gdf.hvplot(geo=True)
----------------
DataError: Supplied data does not contain specified dimensions, the following dimensions were not found: ['Longitude', 'Latitude']
PandasInterface expects tabular data, for more information on supported datatypes see http://holoviews.org/user_guide/Tabular_Datasets.html
当我使用hvplot(geo=False) 时,它可以工作,但我想要一张底图并从 Geoview 的所有选项中受益。
有人有想法吗?
【问题讨论】:
-
please do not upload images of code, data, or tracebacks - 它们不可搜索,也无法被屏幕阅读器阅读。相反,请作为格式化的代码块发布。谢谢!
标签: python postgis geopandas holoviews geoviews