arcpy.env.workspace("C:/Student/PythonGP10_0/Data/SanJuan.gdb")
arcpy.env.overwriteOutput = True
fcList = arcpy.ListFeatureClasses()
bufferList = []
for fc in fcList:
if fc == "Lakes" or fc == "Streams":
arcpy.Buffer_analysis(fc, fc + "Buffer", "1000 meters")
bufferList.append(fc + "Buffer")
arcpy.Union_analysis(bufferList, "WaterBuffers")
Followed by this error when I run the script:
Traceback (most recent call last):
File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
exec codeObject in __main__.__dict__
File "C:\Student\PythonGP10_0\Scripts\BufferWater.py", line 3, in <module>
arcpy.env.workspace("C:/Student/PythonGP10_0/Data/SanJuan.gdb")
TypeError: 'unicode' object is not callable
根据ArcGIS帮助 ,应设置arcpy.env.workspace
,而不是调用:
arcpy.env.workspace = "C:/Student/PythonGP10_0/Data/SanJuan.gdb"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.