import geopandas as gpd
# shp到geojson
data = gpd.read_file('data.shp')
data.to_file("data.json", driver='GeoJSON', encoding="utf-8")
# geojson到shp
data = gpd.read_file('data.json')
data.to_file('data.shp', driver='ESRI Shapefile', encoding='utf-8')
tips:json文件格式要存为ASNI编码。 可通过记事本另存格式
不然通过工具json转shp会报错
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删