Select to view content in your preferred language

Aggregating multiple rasters using model builder

314
7
2 weeks ago
mllobera
Emerging Contributor

This is  a follow up on my previous post Averaging Multiple Hillshades 

Is it possible within model builder to aggregate rasters that are produced on the fly, i.e. by some iterating process? Say, we simply wanted to add rasters that are being produced from the iteration.

What would be the recommended way of doing this? 

Do we need to generate these previously on disk and then aggregate this? How would we do this in model builder?

Thanks

 

7 Replies
DanPatterson
MVP Esteemed Contributor

If by aggregate, you mean add overlapping rasters, then

Cell Statistics (Spatial Analyst)—ArcGIS Pro | Documentation

with the sum option


... sort of retired...
0 Kudos
mllobera
Emerging Contributor

This is not what I was asking

mllobera
Emerging Contributor

So I take from the silence, that this is not actually possible just using the model builder????
I know this can be done using Python. I am teaching some geoprocessing and I wanted to keep it all within the scope of the model builder. Again, if anyone knows a way of doing this within model builder I am sure my students will appreciate it.

DavidPike
MVP Notable Contributor

What do you mean by aggregate?  Could you elaborate further?

mllobera
Emerging Contributor

Thank David.

Perhaps aggregate was not the best term. I meant to refer to any operation that summarizes (you could think of adding, combining in some way) the rasters. The main point, is that the rasters are being created on the fly. They do not exist previous to starting the process. So say we are adding n rasters that have been created through some process. Can these be combine as they are being generated OR should these be first generated and then combined? What is the recommended way in either of these cases. 
Hope this clarifies a bit more.

 

0 Kudos
DavidPike
MVP Notable Contributor

I think it would be a utilisation of the 'memory' workspace https://www.esri.com/arcgis-blog/products/arcgis-pro/analytics/arcgis-pro-memory-workspace

You might be best just overwriting the memory dataset each time or could then have something like a For loop that iterates over the memory workspace at the end and does your Raster Calculator or Cell Statistics at the end (providing the rasters are distinctly created in the memory worksapce i.e. memory\Ras1, memory\Ras2...

If it was me I would certainly recommend Python.  In my personal opinion I I find Model Builder excellent for simple processes, but not so great for complex use-cases.

0 Kudos
mllobera
Emerging Contributor

Thanks David,

I agree. Indeed, using Python this would be mostly trivial. I actually do not use much Model Builder but it is a good tool for students to gain an initial taste of the possibilities. I was just trying to see whether this was actually achivevable (even it was not desirable) for the sake of my students. I was hoping it would be without having to resort to Python scripting.

Thanks again.