首页 > 编程语言 > 详细

arcgis python获得字段唯一值

时间:2019-05-11 13:25:57      阅读:206      评论:0      收藏:0      [点我收藏+]

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获得字段唯一值

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!