【发布时间】:2018-10-20 14:04:49
【问题描述】:
我有一个地理数据框“all_locations”,其中包含一个几何列和一个包含点名称的列。在地图上绘制点可以正常工作,但我想用位置名称注释这些点。
['位置'] ['几何']
BUITHVN8 点()
(实际数据框当然要大得多)
我已经尝试过这个(和其他东西):
all_locations['coords'] = all_locations['geometry'].apply(lambda x: x.point.coords[:])
all_locations['coords'] = [coords[0] for coords in all_locations['coords']]
all_locations.plot(ax=ax)
for idx, row in all_locations.iterrows():
plt.annotate(s=row['locatie'], xy=row['geometry'])
添加坐标列但出现此错误:''Point' object has no attribute 'point'
【问题讨论】:
标签: python-3.x geopandas