Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python arcpy:程序在intersect上崩溃_Python_Python 2.7_Gis_Arcpy - Fatal编程技术网

Python arcpy:程序在intersect上崩溃

Python arcpy:程序在intersect上崩溃,python,python-2.7,gis,arcpy,Python,Python 2.7,Gis,Arcpy,我正在编写一个程序,该程序接受使用pgsql2shp.exe导出的两个形状文件的输入,并在它们之间进行交集。这是我的密码 print sys.argv[1], sys.argv[2] intersection = '' arcpy.Intersect_analysis([sys.argv[1], sys.argv[2]], intersection, "ALL") 其中sys.argv[1]和[2]是指向相交的.shp文件的绝对路径。e、 g.U:\proj\a.shp和U:\proj\b.s

我正在编写一个程序,该程序接受使用pgsql2shp.exe导出的两个形状文件的输入,并在它们之间进行交集。这是我的密码

print sys.argv[1], sys.argv[2]
intersection = ''
arcpy.Intersect_analysis([sys.argv[1], sys.argv[2]], intersection, "ALL")
其中sys.argv[1]和[2]是指向相交的.shp文件的绝对路径。e、 g.U:\proj\a.shp和U:\proj\b.shp

它会编译,但运行时会给出

回溯(最近一次呼叫最后一次):第45行,在 arcpy.Intersect_分析([sys.argv[1],sys.argv[2]],out_path,“ALL”)第289行,在Intersect中 raise ARCGISCRIPTING.ExecuteError:未能执行。参数无效。错误000735:输出要素类:值为 “必需”无法执行(相交)


如何修复它以及在哪里访问返回值?我想把结果放在数据库的一个表中。我不熟悉Python、ArcPy和GIS。

您已将输出要素类的名称设置为空字符串。尝试:

intersection = "Intersect_Output"

输出要素类(此处为Intersect_output)将写入您正在使用的地理数据库。

现在它给出了
arcgisscripting.ExecuteError:ERROR 000210:无法创建输出Intersect_输出无法执行(Intersect)。
您是否设置了arcpy.env.workspace(即arcpy.env.workspace=)不,我是新来的,不知道这意味着什么?您需要指定您正在使用的地理数据库的路径。您应该查看ESRI在其帮助页面中提供的帮助,以进行澄清。