arcgis python獲得字段唯一值
阿新 • • 發佈:2019-05-11
search tin geo inf pri input nat num www. 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獲得字段唯一值
# 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 = []
# 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獲得字段唯一值