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
Contributor
Posts: 29
Registered: ‎01-31-2017
Accepted Solution

Spatial Model - How to categorize NDVI

Dear All,

 

I trust you are well.

 

I am building a spatial model on Crop vigour ( see attached)

 

In the model id like to categorize NDVI as follows;

 

Values                     Category

 -1.0 to - 0.2             Deep Water

 -0.1 to 0.1               Rocks/sand/snow

  0.2 to 0.5               Shrubs/Grasslands/Senescing crops

  0.6 to 0.9               Dense Vegetation  

 

As in this section here, however as i run the model - the only categorize the image is classified in are the first two.- deep water and barren rock.

 

Is there a better way to classify? rather than using the catogery operator?

 

Capture1.JPG

Please help.

 

Kind regards,

Lilian

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

Re: Spatial Model - How to categorize NDVI

[ Edited ]

Hi Lilian,

 

The way you've built the model, the Criteria statements all produce class 1 for the locations that meet the criteria. So the Add operation only ever adds 1 to 0 and therefore produces 1. So you only have classes 0 and 1 produced.

 

What you really want to do is use a single Criteria to evaluate all 4 criteria as one and produce 4 (really 5) classes. Like this:

 

conditional.png

 

Do you really want the extra Raster Outputs? 

 

Let me tidy up the model and send it back.

 

Cheers

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

Re: Spatial Model - How to categorize NDVI

Hello Lilian,

 

You would need to define your classes within a one Criteria operator, like in a model below

2018-07-16 16_47_00-Start.png

 

To add new class condition use an "Add a new class row" button in Criteria dialog window, like below:

 

2018-07-16 16_29_26-Criteria.png

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

Re: Spatial Model - How to categorize NDVI

There was also a problem with the attribute tables - you only had 4 rows, whereas you have (potentially) 5 output classes (Class 0, 1, 2, 3, and 4). So I fixed those too,. The attached model should do the trick (but I did not test it since I don't have your data).

 

Cheers

 

 

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Occasional Contributor
Posts: 7
Registered: ‎12-05-2018

Re: Spatial Model - How to categorize NDVI

[ Edited ]

Hi,

 

I am trying to reclassify an NDWI image to create a Water Mask, using SPATIAL MODELER.  If I use the Criteria operator, I may create different classes, spicifiying the range of values, but as far as I understand in this post there is no field where you add the new pixel values. I mean, I need my new image have:

 

  • Pixels >= 0,5 ---  new value= 0
  • Pixels <0,5  -----  new value= 1

How can I do that?

 

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

Re: Spatial Model - How to categorize NDVI

[ Edited ]

Hi Deckard,

 

I'm actually working on a model that calculates dNBR and then categorizes the index into Burn Severity classes (six of them, 0 to 5). It also names and assigns colors to the classes, but you may not need to do that bit. This is what I'm using:

 

conditional.png

 

Great thing about this is that you can Preview the model, vary the threshold values and see the results in real-time. Once you're happy with the thresholds you can click Run and spend the time to produce an output file.

 

Cheers

 

Ian

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

Re: Spatial Model - How to categorize NDVI

[ Edited ]

Or ... if you look back at Marina's post above, the Criteria operator's CellArray has a Class column, That's where you specify the output DN value (class value) that you want for pixels which meet that criteria. 

 

In my example it's the Valuen ports on the Conditional operator whch set the output DN values.

 

Either way works.

 

Cheers

 

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Highlighted
Occasional Contributor
Posts: 7
Registered: ‎12-05-2018

Re: Spatial Model - How to categorize NDVI

It worked, thanks a lot!

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

Re: Spatial Model - How to categorize NDVI

In case anyone's interested, the full set of Burn Indices models is now posted in the Spatial Modeler Tutorials section:

 

https://community.hexagongeospatial.com/t5/Spatial-Modeler-Tutorials/Generating-Burn-Indices-from-Sa...

 

Cheers

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.