def getdata(path,suffix):
l = []
files = os.listdir(path)
for file in files:
if "."+ suffix in file and (len(file) - len(suffix) - 1 == file.index("."+suffix)):
l.append(path + file)
return l
2.在arcgis中创建一个图层包,通过该图层包渲染其他图层。
创建图层包:
批量渲染图层:
import arcpy
arcpy.env.workspace = r"E:\DDE2\DDE3\接边处理\消除"
shps = arcpy.ListFeatureClasses()
for i in range(len(shps)):
arcpy.ApplySymbologyFromLayer_management(shps[i], "D:\proproject\查看\检查.lyrx")
3.峰仔的工具
import arcpy
dbf = r"D:\proproject\峰仔\标识表\costdis2000_标识表.dbf"
def fengzai(name, max_test, max_index):
name.append(max_test)
name.append(max_index)
with arcpy.da.UpdateCursor(dbf,name) as cursor:
for row in cursor:
MAX = max(row[:-2])
row[-2] = MAX
row[-1] = max_index
cursor.updateRow(row)
def max(row):
temp = [float(row[i]) for i in range(len(row))]
a = temp[-1]
return a