Hexagon Geospatial
MENU

Spatial Modeler

Discuss topics with other Hexagon Geospatial Product pioneers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Frequent Contributor
Posts: 106
Registered: ‎06-04-2016
Accepted Solution

Creating a Table from data selected from feature attributes

Folks, 

 

Various operators (e.g., Statistics, EigenMatrix, etc) operate on pixel values, but I want to run those operators against data selected from multiple feature attribute columns (e.g, the columns created by MeasurePolygon named M_CENTER_X and M_CENTER_Y). 

 

I tried SelectingAttributes and Converting the AttributeTable into a Table and although the operation succeeded it appears the patient died as I only see one column of values.

 

 

I then attempted to pipe the SelectedAttributes into an Iterator that could sequentially pull the Nth item from each attribute listing, but couldn't figure out the syntax for creating a record/tuple using the 'Dynamic Table Input (List)' operator (DTIOL). I tried csv values (+w/ space delimiter), the syntax 'Float(List(2: 333 666))' (but that throws an error unless I set Count=1), and through modeling using a couple of IntInputs connected to the DTIOL's ListItem port (but it only accepted one connection). The operator doesn't have an associated dialog that I could use to build a tuple and learn the syntax, no examples in the docs or the community so I'm at a loss.

 

How do you run stats against multiple attribute columns like X,Y fields?

 

Regards

 

Technical Evangelist
Posts: 698
Registered: ‎10-01-2015

Re: Creating a Table from data selected from feature attributes

Hi Noel,

 

Some quick thoughts on this issue:

 

  1. Select Attribute already creates a Table as its default output datatype. So I don't think you need to create a column and then convert the column back to a table.
  2. An IMAGINE.Table by defintion is a single column of data. Perhaps that's why you were trying to use Columns (to get more than a single column)? That's not going to work - when you convert back to Table you're going to drop everything but the first column in order to form a Table. 

 

That probably doesn't help you achieve what you are trying to achieve, but at least (hopefully) indicates why the current approach isn't working.

 

Could you perhaps define what it is you're actually trying to do (what's the problem you're trying to solve) and that might help in coming up with some suggestions that help move you forward. Perhaps a linear regression between the two varaibles is what you're looking for?

 

Cheers

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Technical Evangelist
Posts: 29
Registered: ‎01-29-2016

Re: Creating a Table from data selected from feature attributes

As Ian said, IMAGINE tables only have one column. You can however create a Matrix with multiple columns from a set of tables. You can then compute statsistics on the matrix. Example of creating a matrix from two tables:

 

matrix from two tables.JPG

Frequent Contributor
Posts: 106
Registered: ‎06-04-2016

Re: Creating a Table from data selected from feature attributes

Wizardry. I tried to reproduce, but it appears my DynamicMatrixInputList node has different ports. Would you happen to have the GDMX?

 

 

I think I get what's going on though. By multiplying each vector of Nx1 values with a pair of binary 1x2 matrices [0 1] or [1 0], you're copying each vector's values into one column of an intermediate matrix while the other column is all 0. Adding combines the results.

 

For example:

 

v1 = [1 2 3];
v2 = [4 5 6];

[ 1 ]                 [1   0]
[ 2 ]  *  [1  0] =    [2   0]
[ 3 ]                 [3   0]


[ 4 ]                 [0   4]
[ 5 ]  *  [0  1] =    [0   5]
[ 6 ]                 [0   6]


[1   0]        [0   4]      [1   4]
[2   0]   +    [0   5]  =   [2   5]
[3   0]        [0   6]      [3   6]

Regards

 

Frequent Contributor
Posts: 106
Registered: ‎06-04-2016

Re: Creating a Table from data selected from feature attributes

Hi Ian,

 

 

 

You edited or co-authored this article where you used the EigenMatrix operator to implement PC, but sourced data from an image. I was trying to apply that technique to data sourced from feature layer attributes (e.g., ordinates), but ran into this data type/shape issue.

 

Regards

 

Technical Evangelist
Posts: 698
Registered: ‎10-01-2015

Re: Creating a Table from data selected from feature attributes

[ Edited ]

I think what Larry has done with his Operators is right click on them and use the Add Port option to add the second item for the list. He has then hidden the Normalise port so you don't see it in the screenshot of his model. Try that - I think it should work for you,

 

And yes, your explanation of how the matrix algebra is intended to work is spot on.

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.