我在 ArcGIS 10 上工作,我想实现图层之间的多个联合。但是那个联合任务有点特殊。事实上,正如我的代码开头所示,我有七层(这些层有一个特定的分类)。
import arcpy
from arcpy import env
workspace_2 = "V:/DONNEES/1_referentiels/mnt/1_france/1_dep_17/ign/litto3d/Litto3D_livraison_2011_10_24/traitements_lienss/tests/Workspace_chev/"
M0 = workspace_2 + "0.shp"
M1 = workspace_2 + "1.shp"
M2 = workspace_2 + "2.shp"
M3 = workspace_2 + "3.shp"
M4 = workspace_2 + "4.shp"
M5 = workspace_2 + "5.shp"
M6 = workspace_2 + "6.shp"
M7 = workspace_2 + "7.shp"
我的目标是在 M0 - M4、M1 - M5、M2 - M6 等之间建立一个联盟。也就是说工会每四层都要做出来。所以我决定做一个循环,但我必须承认我完全迷路了。我试过了,但没有用:
Union_1 = {"M0":M0, "M1":M1, "M2":M2, "M3":M3}
Union_2 = {"M4":M4, "M5":M5, "M6":M6, "M7":M7}
for i in Union_1:
for j in Union_2:
InFeatures = [Union_1[i], Union_2[j]]
arcpy.Union_analysis (InFeatures, i + "_" + j + ".shp", "NO_FID", 0.0003, "")
print "ok"
你能帮我循环那个联合过程吗?