使用Python Shapefile Library創建和編輯Shapefile文件


介紹

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文件

Python Shapefile Library

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM