Hexagon Geospatial


Discuss and share topics of interest using ERDAS IMAGINE the world’s leading geospatial data authoring system.
Showing results for 
Search instead for 
Do you mean 
Frequent Contributor
Posts: 78
Registered: ‎04-02-2017

How to Utilise Erdas Imagine modules in Python 3.4

Hi there,



I want to have two outputs in my Python script (X,Y) so I can pass these to other Spatial Model functions.

Does this require utilising Erdas Imagine's libraries?


In https://hexagongeospatial.fluidtopics.net/reader/XWswM6TZr3V__hu3iKjbGA/ysnwcjTwrHckZ_bAWvFKCQ I found the following Python script for multiple outputs.


if __name__ == '__spatialmodeler__':
global __operator__
__operator__ = {
'inputs': [
{ 'name': 'A', 'types': ['IMAGINE.Double'] },
{ 'name': 'B', 'types': ['IMAGINE.Double'] },
'outputs': [
{ 'name': 'Sum', 'types': ['IMAGINE.Double'] },
{ 'name': 'Difference', 'types': ['IMAGINE.Double'] },

def SumAndDifference(a, b):

return a+b, a-b

Is this the best way to do this?

Also, to utilise the Imagine module I have set the Environment Path Variable to C:\Program Files\Hexagon\ERDAS IMAGINE 2018\usr\lib\X64Release\python as noted in



When I run the script in Powershell it doesn't recognise the imagine module (from imagine.modeler import Model, Operator). Have I missed something?





Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.