06-30-2016 03:19 AM
This may be a silly question, but I am building a complex model and need help.
My model creates a shapefile of polygons (segments), and a raster image of meaningful values. What I'd like to do is populate the polygons with the MEAN statistical value of the raster image values, within a new column in the attribute table.
Manually I can go to the Raster Tab -> Thematic -> Zonal Attributes to do the said analysis, however I'd like to find out if there is an approach to do this in the Spatial Modeler (through different operators), so that I can complete this analysis as part of my complex model?
Thanks in advance!
Solved! Go to Solution.
07-05-2016 04:04 AM
Below you can find an illustration of how you can add the MEAN statistical value of the raster image values within a new column in the attribute table.
Also attaching the model.
Hope this will help.
07-07-2016 12:26 PM - edited 07-07-2016 12:27 PM
07-07-2016 10:19 PM
Hi Marina and Ian,
Marina thanks for the awesome response, I have implemented the suggested model and it has really helped! So thank you!
Ian, I am glad you added the workflow (ERDAS 2016), because I was having trouble with the background row being included into the attribute transfer, so the "Remove Background Row" is exactly what I needed. Thanks.
My 2 cents, if the zones exist in raster as an input, the process is 10x faster inputing the raster zones than shapefile zones, and then adding the zonal attribute to the raster and then converting the raster to shapefile.
Also, the zonal mean attribute's accuracy is higher when analysing zonal raster to class raster, than zonal shapefile to class raster (which is understandable since the shapefile has to be converted to a raster cell before the zonal statistic processing can take place). This is only the case if the zones are available as raster and shapefile.
Anyways thanks guys, you are flippin awesome.
06-15-2020 01:57 AM
Did you manage to change "ZonalMean" to reflect the input image name and band? I am trying rename attributes but am getting the same old ZonalMean attribute name and green check marks in the modeller.