zoukankan      html  css  js  c++  java
  • 脚本中shp文件在arcgis10.1下可以访问。在10.3下貌似不行

    arcgis10.1下可以运行。在10.3下不行

     1 import arcpy,os
     2 
     3 # input data 
     4 input_layer = r'D:	est03shpall.shp'
     5 split_field = r'NAME'
     6 
     7 #
     8 with arcpy.da.SearchCursor(input_layer, [split_field]) as cursor:
     9     for row in cursor:
    10         print row[0]

    在10.3下

     1 import arcpy,os
     2 
     3 # input data
     4 arcpy.en.workspace=r'D:	est03shp    #10.3下存放shp的文件夹设为工作目录才行
     5 input_layer = 'all.shp'
     6 split_field = r'NAME'
     7 
     8 #
     9 with arcpy.da.SearchCursor(input_layer, [split_field]) as cursor:
    10     for row in cursor:
    11         print row[0]
  • 相关阅读:
    fort循环
    while
    函数和数组
    case
    init进程
    权限安全:堡垒机部署实践
    tcp首部当中seq和ack的增长规律
    VRRP
    MSTP
    字符集专题
  • 原文地址:https://www.cnblogs.com/gistwz/p/7977566.html
Copyright © 2011-2022 走看看