-
创建 GeoDataFrame 输出 geojson 文件
import geopandas ss = np.stack((lon.flatten(), lat.flatten()), 1) ss1 = [Point(ss[0].tolist()) for i in ss] print(ss) print(ss1) cq = geopandas.GeoDataFrame({'val': data.flatten(), 'geometry': ss1}, crs='EPSG:4326') print(cq) cq.to_file('output.geojson', driver='GeoJSON', # 默认 geojson 可以换成 ESRI Shapefile encoding='utf-8')