介紹
shapefile是GIS中非常重要的一種數據類型,在ArcGIS中被稱為要素類(Feature Classes),主要包括點(point)、線(polyline)和多邊形(polygon)。Python腳本是ArcGIS官方推薦的腳本語言,通過Python腳本能夠很方便的調用ArcGIS中的各種工具和函數批量完成所需操作。
安裝
sudo pip install pyshp
使用
import shapefile shop_layer = shapefile.Reader(os.path.join(self.folder, self.name)) key_index = 1 for shop_record in shop_layer.iterRecords(): key = shop_record[key_index]
參考
使用Python Shapefile Library創建和編輯Shapefile文件
