ArcGIS Spatial Analyst

Introducing the Raster Cell Iterator

Have you ever wished you could easily interact with raster datasets in ArcGIS Pro at an individual cell level? Be able to read and write cell values directly, and create your own custom analysis routines? Look no further, as the Raster Cell Iterator (RCI) in ArcGIS Pro 2.5, lets you do just that. RCI is available through the Spatial Analyst module, an extension of the ArcPy Python site package. With RCI, visit each cell location in a Raster object, all in a Python environment. The iterator makes it easy to query and modify cell values at each cell location and its neighboring cell locations. Iterable access to raster cells enables you to write custom raster analysis scripts and combine them with the existing suite of Spatial Analysis geoprocessing tools, expanding your analytical capabilities immensely!

Here is a short video that helps you get started with RCI and shows how to use it for custom raster analysis.

As you can see in this video, using RCI is very simple and requires few lines of coding. You can invoke RCI on a single raster object or multiple raster objects to iterate through their row and column indices. Using these indices, you can query a cell value at a given cell location. You can also query neighborhood cell values by using relative indexing. Additionally, you can use index notation to write cell values to an output raster.

Be sure to download the latest version of ArcGIS Pro 2.5 to try out RCI and explore its capabilities.

Additional Resources

Read A quick tour of using Raster Cell Iterator to get started with RCI in ArcGIS Pro.

Read the blog Unleash the power of RasterCellIterator to perform custom raster analysis, which illustrates how to apply RCI to solve a read-world problem.

About the author

Neeraj Rajasekar is a Senior Product Engineer in the raster analysis group at Esri. His work focuses on developing innovative solutions for raster based analysis and computation on the ArcGIS platform. He specializes in surface & subsurface water modeling and has a Master of Science degree in Civil and Environmental Engineering from Stanford University.


Next Article

Virtualizing 3D training models with NVIDIA AI Enterprise

Read this article