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: 2
Registered: ‎05-06-2019

Expression Editor and SML (to calculate area of raster classes)

[ Edited ]

hello,

I am trying to calculate area with operators available in Expression Editor but I can't figure out the right syntax

Process is to get CellX and CellY in meters from raster and multiply it and attaching new collumn as attribute to output raster

raw syntax is attached in

 

I am thankfull for any ideas how the SML work in Expresion Editor

The available docu doesn't make sense to me

Highlighted
Technical Evangelist
Posts: 906
Registered: ‎10-01-2015

Re: Expression Editor and SML

Hi LKAMA,

 

Personally I wouldn't go with the Expression Editor to do this, I'd just use Spatial Modeler.

 

Have you reviewed this thread:

 

https://community.hexagongeospatial.com/t5/Spatial-Modeler-Discussions/Extracting-Raster-Area-using-...

 

It contains all the information you need to generate class area and add it back as an attribute field.

 

Hope that helps.

 

Cheers

 

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

Re: Expression Editor and SML

[ Edited ]

For example, the following would calculate the area of each class in hectares and add a column called "Hectares" to the original image to store that information:

 

Hectares.PNG

 

If I needed to do this as part of a larger Spatial Model which is processing data (e.g. running Clump) and producing a new output file (to which I want the area attributes attached), I would do it this way:

 

Hectares2.PNG

 

 

Hope that helps.

 

Cheers

 

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Highlighted
New Contributor
Posts: 2
Registered: ‎05-06-2019

Re: Expression Editor and SML

Thank you Ian.

The models helped BUT I am trying to understand how the Expresion Editor works.

I read the documentation to SML but didn't help. Do you maybe know where can I found some examples of SML in Expression Editor?

Thanks in advance,

LK