(1)、通过shapely地理列表构造 GeoDataFrame
d = {‘属性’: [‘关联湖泊小区’]*len(contains), ‘geometry’: contains}
gpd.GeoDataFrame(d,crs=4326)
(2)、通过pandas构造 GeoDataFrame
cell=pd.read_sql_table(‘Parament4G’,con=enginenetwork)
print(cell.to_json())
cell[‘Lon’]=cell.Lon.apply(lambda x:float(x))
cell[‘Lat’]=cell.Lat.apply(lambda x:float(x))
cell=gpd.GeoDataFrame(cell,geometry=[Point(cell.iloc[i][[‘Lon’,‘Lat’]]) for i in range(len(cell))],crs=4326)
print(cell.head())