很久没用arcpy了,碰了好几次壁,把这次做的贴上来,以备下次可以跳过这些简单的问题

 1 import arcpy
 2 arcpy.env.workspace = 'C:\Users\Qian\Documents\ArcGIS\Default.gdb'
 3 a=['sichuan1990','sichuan2000','sichuan2010']
 4 b=['藏族','彝族','羌族','回族']
 5 for x in a:
 6     for y in b:
 7         arcpy.MeanCenter_stats(x, x+y+"1.shp", y, "#", "#")
 8         
 9 import arcpy
10 arcpy.env.workspace = 'C:\Users\Qian\Documents\ArcGIS\Default.gdb'
11 a=['xinjiang1990','xinjiang2000','xinjiang2010']
12 b=['维吾尔族','哈萨克族','回族','柯尔克孜族']
13 for x in a:
14     for y in b:
15         arcpy.MeanCenter_stats(x, x+y+"1.shp", y, "#", "#")

重点在于计算地理中心函数的第一个变量无需加.shp。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-08-05
  • 2022-12-23
  • 2021-06-08
  • 2022-01-19
猜你喜欢
  • 2021-07-29
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-08-06
  • 2021-10-05
  • 2021-07-31
相关资源
相似解决方案