创建缓冲然后相交的Arcmap工具

时间:2016-05-18 08:10:09

标签: python-2.7 arcpy arcmap

我试图创建一个缓冲要素类(多边形)的工具,然后将缓冲输出层与点shapefile相交。当我运行该工具时,缓冲区分析运行并完成,但交叉分析不会。错误消息是

  

ExecuteError:无法执行。参数无效   ERROR 000732:(我的缓冲区输出图层和点形状文件)不存在或不受支持
  无法执行(相交)。

我的所有图层都加载到我的arcmpap中,因此我不确定为什么会这样做。

import arcpy

in_Path = arcpy.GetParameterAsText(0) # first parameter in the interactive tool
out_Path = arcpy.GetParameterAsText(1)  # second parameter in the interactive tool

bufferDistance = arcpy.GetParameterAsText(2)# third parameter in the interactive tool

result_buffer = arcpy.Buffer_analysis(in_Path, out_Path, bufferDistance,"FULL", "ROUND", "ALL", "") #the parameters to able compute the tool
# ^^ assign variable for the buffer analysis tool 

in_CitiesShapefile = arcpy.GetParameterAsText(3)# fourth parameter in the interactive tool

out_CitiesWithinBuffer = arcpy.GetParameterAsText(4) # fifth parameter in the interactive tool

arcpy.Intersect_analysis([out_Path, in_CitiesShapefile], out_CitiesWithinBuffer,"ALL", "", "INPUT") #the parameters to able compute the tool

1 个答案:

答案 0 :(得分:0)

文件/文件夹路径出现问题时,通常会出现此错误。

我会检查以下路径的参数:

  • 拼错文件夹名称
  • 使用反斜杠代替正斜杠
  • 路径名称中包含空格

esri kb article可能有所帮助。