【发布时间】:2021-10-27 18:22:55
【问题描述】:
我有一个地理数据框:
gdf
name ... geometry
0 INET_PL_273_EE_0_Seg_0_Seg_0 ... {'type': 'LineString', 'coordinates': [[23.896...
1 INET_PL_273_EE_1_Seg_0_Seg_0 ... {'type': 'LineString', 'coordinates': [[22.241...
2 INET_PL_357_Seg_0_Seg_0 ... {'type': 'LineString', 'coordinates': [[13.592...
3 INET_PL_359_Seg_0_Seg_0 ... {'type': 'LineString', 'coordinates': [[13.592...
4 INET_PL_361_Seg_0_Seg_0 ... {'type': 'LineString', 'coordinates': [[13.592...
... ... ... ...
6318 EntsoG_Map__ST_25_Seg_0 ... {'type': 'LineString', 'coordinates': [[13.887...
6319 EntsoG_Map__ST_26_Seg_0 ... {'type': 'LineString', 'coordinates': [[23.080...
6320 EntsoG_Map__ST_26_Seg_0 ... {'type': 'LineString', 'coordinates': [[6.7552...
6321 EntsoG_Map__ST_448_Seg_0 ... {'type': 'LineString', 'coordinates': [[25.348...
6322 EntsoG_Map__ST_449_Seg_0 ... {'type': 'LineString', 'coordinates': [[25.348...
[6323 rows x 7 columns]
我通过gdf['geometry'] = gdf['geometry'].apply(lambda x: shapely.geometry.mapping(x)) 创建了几何列。现在我想把它转换回来。
有什么简单的技巧吗?
【问题讨论】:
标签: python dataframe geojson geopandas shapely