在 Python 中處理地理空間資料
Joris Van den Bossche
Open source software developer and teacher, GeoPandas maintainer
IPIS:International Peace Information Service
圖片:G.A.O,公有領域,取自 Wikimedia Commons
讀取檔案:geopandas.read_file("path/to/file.geojson")
支援的格式:
.shp、.dbf、.shx、.prj、…).gpkg)以及 PostGIS 資料庫!
使用 to_file() 方法將 GeoDataFrame 寫出到檔案:
# 寫出 Shapefile 檔
geodataframe.to_file("mydata.shp", driver='ESRI Shapefile')
# 寫出 GeoJSON 檔
geodataframe.to_file("mydata.geojson", driver='GeoJSON')
# 寫出 GeoPackage 檔
geodataframe.to_file("mydata.gpkg", driver='GPKG')
在 Python 中處理地理空間資料