geopandas–提取gdf中的geometry中的x,y
if gdf['geometry'].geom_type[0] == 'Point':
gdf['x'] = gdf['geometry'].apply(lambda geom: geom.x)
gdf['y'] = gdf['geometry'].apply(lambda geom: geom.y)
gdf.gemetry合并(unary_union)
gdf.plot()
gdf.geometry
0 LINESTRING (114.18080 30.50960, 114.18454 30.5...
1 LINESTRING (114.18454 30.50746, 114.18823 30.5...
2 LINESTRING (114.18224 30.51141, 114.18940 30.5...
Name: geometry, dtype: geometry
gdf.geometry.unary_union
type(gdf.geometry.unary_union)
shapely.geometry.multilinestring.MultiLineString