08-17-2016 06:48 AM
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!
Solved! Go to Solution.
08-18-2016 07:23 AM
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:
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.
08-19-2016 10:01 AM
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.
09-11-2016 06:33 AM
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?
09-20-2016 11:13 AM - edited 09-20-2016 11:36 AM
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.