码迷,mamicode.com
首页 > 编程语言 > 详细

arcgis python获得字段唯一值

时间:2019-05-11 13:23:15      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:lis   row   call   eric   imp   val   ESS   end   module   

arcgis python获得字段唯一值

# Import native arcgisscripting module
import arcgisscripting, sys
# Create the geoprocessor object
gp = arcgisscripting.create(9.3)

# Table and field name inputs
inTable = sys.argv[1]
inField = sys.argv[2]

rows = gp.SearchCursor(inTable)
row = rows.Next()
# Create an empty list
uniqueList = []
while row:
    # If the value is not already in the list, append it
    if row.GetValue(inField) not in uniqueList:
        uniqueList.append(row.GetValue(inField))
    row = rows.Next()
# Sort the list alphanumerically    
uniqueList.sort()
print uniqueList

 
分类: Python

arcgis python获得字段唯一值

标签:lis   row   call   eric   imp   val   ESS   end   module   

原文地址:https://www.cnblogs.com/gisoracle/p/10848289.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!