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

原文地址:https://www.cnblogs.com/kaituorensheng/p/8127587.html