10-17-2019 10:53 PM - last edited on 10-22-2019 01:52 PM by ian.anderson
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!
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!
Solved! Go to Solution.
10-22-2019 01:56 PM
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.