Spatial Modeler Discussions

Gain, exchange, and share knowledge, or discuss topics with other Hexagon Geospatial Product pioneers and experts to get the most out of Hexagon Geospatial products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎10-17-2019
Accepted Solution

Replicate Matrix Union in Spatial Modeler

[ Edited ]

Hi Ian!

 

What would be the best way to include the Matrix Union algorithm into a spatial model? I would like to develop a model which produces the same output as the tool Raster>Thematic>Matrix Union. The Multiply-Operator didn't give back satisfying results. I'm currently using ERDAS IMAGINE 2018.

 

Thanks in advance for your help!

 

Best regards

Roman

 

EDIT:

I was able to implement the Matrix Union algorithm into the spatial model with the 'Expression'-Tool. I basically get the same output raster as when applying the tool Raster>Thematic>Matrix Union manually with one flaw: the attributes of the original classIDs of the two input images are missing. Unfortunately, I was not able to attach the attributes accordingly within the spatial model, which makes the output raster more or less useless, as one can not retrace the changes/differences between the two images.

I was working on a solution with a combination of 'row count', 'dynamic table input', 'table to matrix', 'matrix transpose', and 'matrix multiplication' but was not able to generate two tables, which should basically look like this:

 

Number of class of input images: e.g. 5 (the number of classes in the input image can change)

Attribute table 1: 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5

Attribute table 2: 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5

 

I would be very glad for any hint or advice!

Thanks and best regards!

 

Roman

Highlighted
Technical Evangelist
Posts: 1,010
Registered: ‎10-01-2015

Re: Replicate Matrix Union in Spatial Modeler

Moved topic to its own thread.

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Highlighted
Technical Evangelist
Posts: 1,010
Registered: ‎10-01-2015

Re: Replicate Matrix Union in Spatial Modeler

Hi Roman,

 

The attached Spatial Model should replicate the Matrix Union functionalty from the perspective of adding two attribute columns which show the orignal two input file class (DN) values. 

 

I havent; attempted to add "bells and whistles" - I just wanted to get the basic model to you. If I get a chance I may clean it up so, for example, the attribute columns are named based on the input filenames, Port Inputs used to prompt for input filenames, etc. 

 

Cheers

 

 

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Highlighted
New Contributor
Posts: 4
Registered: ‎10-17-2019

Re: Replicate Matrix Union in Spatial Modeler

Hi Ian!

 

Exactly what I was looking for Smiley Happy Thank you very much! I really appreciate it!

 

Best regards

Roman