python gdal 修改shp文件的属性值

driver = ogr.GetDriverByName('ESRI Shapefile')
datasource = driver.Open(shpFileName, 1)
layer = datasource.GetLayer()
for feature in layer:
dataValue = numArray[j][i]
feature.SetField(field, dataValue)
layer.SetFeature(feature)
layer.ResetReading()
posted @ 2017-11-16 11:25  忆如梨花  阅读(1343)  评论(0编辑  收藏  举报