使用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