Hexagon Geospatial
MENU

Smart M.App

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 59
Registered: ‎04-19-2016
Accepted Solution

Iterate through every feature and perform recipe

Hi there,

 

Is it possible to iterate through multiple features/polygons in a feature dataset and for each feature perform a recipe action or a subset of an output and display all outputs of the recipe on a map?

 

Eg. I have a 10 polygon boundaries in my feature dataset, and I have a NDVI processed image that covers the feature dataset. How can I iterate a process for each polygon, where the polygon subsets the NDVI image and outputs a NDVI chip/subset with a defined colour ramp, and this is done for all 10 polygons. I then want to display the NDVI chip/subsets in a map in my app. Can this be done?

 

I am able to do a subset with all 10 polygons do problem, however displaying the colour ramp to NDVI spread over 10 polygons is skewing the visual result and the user is unable to see anomalies within a single polygon...hope I am making sense! 

 

Thanks

 

Cheers

Technical Evangelist
Posts: 29
Registered: ‎01-29-2016

Re: Iterate through every feature and perform recipe

Jens,

 

Are you saying you want to apply the color ramp differently to each polygon, based on the statistics of pixels within that polygon?

 

It sounds like this would be easy in IMAGINE, by modying the model I posted here:

http://community.hexagongeospatial.com/t5/Support-ERDAS-IMAGINE/Spatial-Modeler-Subset-to-many/m-p/5...

 

In Smart M.App, you would need to provide an output file for each polygon, which would be possible though tedious with 10 polygons, but probably not possible currently with an arbitrary number of polygons.

 

Larry

Technical Evangelist
Posts: 29
Registered: ‎01-29-2016

Re: Iterate through every feature and perform recipe

If you can use one output image where the stats computed on NDVI within each polygon are used to set the colors 

instead of one output image for each polygon, the attached recipes might work for you.

 

In each recipe zonal statistics are computed using each polygon as a zone, the NDVI data is stretched based on the zonal stats, and colors assigned to the stretched data. One recipe uses a min-max stretch, the other uses mean +/- 2 standard deviations for the stretch.

 

 

Contributor
Posts: 59
Registered: ‎04-19-2016

Re: Iterate through every feature and perform recipe

Thank you Larry! Appreciate the assistance

Contributor
Posts: 59
Registered: ‎04-19-2016

Re: Iterate through every feature and perform recipe

Larry I need your help again.

 

The stretch by zone model that you told me to use works well, however I am having trouble with visualizing the data, as the 0 value or nodata value is being displayed as a color and is not transparent. So at the moment the colours are being stretched in each polygon according to a raster value, however outside the polygons where I'd like no stretch and just a transparent class there is a color. The value in these areas is zero.

Things I have tried to fix the problem.

Start the colors at 1 and not default in the color ramp.

Added a operator to set zero to nodata

Subset the data using the polygons

 

Please assist. Is there anyway I can have the model ommit anything outside the polygon areas?

 

Thanks

 

Jens

Technical Evangelist
Posts: 29
Registered: ‎01-29-2016

Re: Iterate through every feature and perform recipe

Jens,

 

Sorry, I was out last week.

 

I think the attached updated models should work for you.

 

Larry

Technical Evangelist
Posts: 29
Registered: ‎01-29-2016

Re: Iterate through every feature and perform recipe

[ Edited ]

Hmm... those models are getting an error when run in M.App Studio. Not sure why.

Edited to add: Working now. Must have had a server hiccup earlier.

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.