我正在尝试使用Python执行layerstack操作。但是,我遇到了一个错误。在
下面是示例代码:import os,sys
from imagine import modeler
m = modeler.Model()
# Import Bands 1-7
ri1 = m.RasterInput(path + “/” + folderName + “_B1.TIF”)
ri2 = m.RasterInput(path + “/” + folderName + “_B2.TIF”)
ri3 = m.RasterInput(path + “/” + folderName + “_B3.TIF”)
ri4 = m.RasterInput(path + “/” + folderName + “_B4.TIF”)
ri5 = m.RasterInput(path + “/” + folderName + “_B5.TIF”)
ri6 = m.RasterInput(path + “/” + folderName + “_B6.TIF”)
ri7 = m.RasterInput(path + “/” + folderName + “_B7.TIF”)
stackbands = m.StackLayers(ri1,ri2,ri3,ri4,ri5,ri6,ri7)
outputFile = path + “/” + folderName + “-msi.img”
ro = m.RasterOutput(stackbands, outputFile)
m.Execute()
print “\nCreating MS image using bands 1-7…”
我在from imagine import modeler期间出错,错误在这里:
^{pr2}$
我安装了pip install imagine,但在imaging模块中没有建模器属性。如何我能用Python 3.5 and Python 2.7来解决这个问题吗
我还下载了Python Scripting with ERDAS IMAGINE Spatial Modeler 2014,示例python脚本由于缺少属性modeler而无法工作,希望我能找到这个问题的答案。在