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
Frequent Contributor
Posts: 101
Registered: ‎04-02-2017
Accepted Solution

Extracting Raster Area using Spatial Model

[ Edited ]

Hi there,

 

In Erdas Imagine you can add the area of the raster histogram in table>attributes table.

Is this possible in a Spatial Model? I can only see this for features and not raster. I'd like to be able to output a file with the area of the tree canopy from the spatial model.

 

Thanks,

 

Josh

Highlighted
Staff
Posts: 126
Registered: ‎07-04-2016

Re: Extracting Raster Area using Spatial Model

Hi Josh,

 

To calculate the area of classes in the thematic image, you need to multiply the histogram by the cell size (pixel dimensions). The model will look like below (also attached):

 

2018-09-11 10_33_00-New notification.png

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Frequent Contributor
Posts: 101
Registered: ‎04-02-2017

Re: Extracting Raster Area using Spatial Model

That's great. Thanks for that. I've tested it without any errors but it doesn't add the attribute.

Does it need to create a new raster file or can it edit the existing?

 

Regards,

 

Josh

Staff
Posts: 126
Registered: ‎07-04-2016

Re: Extracting Raster Area using Spatial Model

Josh,

 

You need to create a new raster file. At the end of the model, it attaches the Area attribute to the new raster output.   

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Technical Evangelist
Posts: 758
Registered: ‎10-01-2015

Re: Extracting Raster Area using Spatial Model

[ Edited ]

Hi Josh and Marina,

 

Pretty sure that if you're using Raster Attribute Output (as opposed to, say, Attach Attributes) you can attach them to an existing file. Just hook the Port Input operator up to the FilenameIn port of the Raster Attribute Output (and get rid of the Raster Output operator).

 

Cheers

 

 

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Staff
Posts: 126
Registered: ‎07-04-2016

Re: Extracting Raster Area using Spatial Model

Thank you, Ian.

 

You are right, it works perfectly.

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Frequent Contributor
Posts: 101
Registered: ‎04-02-2017

Re: Extracting Raster Area using Spatial Model

I have it working now. I didn't see the two links from the raster to the Cell X and Cell Y.

Thanks for your help.


Josh

Occasional Contributor
Posts: 18
Registered: ‎04-23-2019

Re: Extracting Raster Area using Spatial Model

Hello, continuing to this topic what's the unit area for the result? hectares? 

 

 

Regards,

Dwima

Staff
Posts: 126
Registered: ‎07-04-2016

Re: Extracting Raster Area using Spatial Model

Hello Dwima,

 

In this particular model, the units are taken from the input raster. In my case it was meters, therefore sqmeters for the area calculation. You can also replace the part where I multiplied Cell X by Cell Y with the Cell Area operator and define the units you prefer there.

 

 

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.