Error: 调用Spatial ETL工具时,模型没有属性
文章编号: 38563 软件: ArcGIS - ArcEditor 10 ArcGIS - ArcInfo 10 ArcGIS - ArcView 10 错误信息: 在ArcGIS10.0的Python独立脚本中调用Spatial ETL工具时,可能会遇到以下错误:“属性错误:’Model’对象没有属性”。
原因: 在ArcGIS当前版本中,只要在ArcMap 和 ArcCatalog中勾选Data Interoperability扩展模块就可以调用Spatial ETL工具。
在ArcGIS10.0中,为了成功调用使用Spatial ETL工具,在Python 独立脚本中必须检查Data Interoperability扩展模块。 解决方法: 以下是避免“模型没有属性“错误以及成功调用Spatial ETL工具的必要信息:
1.为编辑打开Python脚本。
2.导入arcpy模型后,将以下代码复制并粘贴到Python脚本中,然后再使用Spatial ETL工具。
class LicenseError(Exception):
pass
try:
if arcpy.CheckExtension("DataInteroperability") == "Available":
arcpy.CheckOutExtension("DataInteroperability")
print "Checked out \"DataInteroperability\" Extension"
else:
raise LicenseError
except LicenseError:
print "Data Interoperability license is unavailable"
except:
print arcpy.GetMessages(2)) |
|
来自: 昵称QAb6ICvc > 《python》