Raster Pixel Editor

Sometimes you want to change the values of the pixels in your rasters. It’s not something you’d necessarily want to do with imagery, but when working with categorical rasters or an elevation model, it can come in handy. Here’s an example that shows how to create a barrier wall for flood prevention on the Outer Banks in North Carolina. Essentially I’ll be creating a new raster which could then be applied to a flood model.

Start with your elevation data and a shapefile that delineates where the wall would go up. Keep in mind that it needs to be a polygon for this to work. When I did this, I created a polyline shapefile and then added a 1 m buffer to it.

outer banks

From the Image Analysis Window, select the elevation layer, and add a function.

Add a functionIn the Editor that pops up, right click on the raster layer and insert a Constant Function. The constant should be the height of the wall that you want to build plus the underlying elevation. Because I’m looking at coastal data, 25 m is fine. If I was modeling the impact of constructing a dam in a high elevation area, I would want to add the elevation to the height of the dam.

After adding the Constant Function, keep the Editor open, and add a Clip Function. Navigate to the shapefile that you created for your area of interest. Select Outside for the Type, and check the box next to Use Input Features for Clipping Geometry. Click OK.

In the Editor window, add a Local Function above the Constant Function. Use the Plus icon to add a raster from disk and select the original elevation data. Under Operations, scroll down and select Maximum (Ignore NoData). Change the extent to Union. Click OK, and you’re all set.

You can create a shapefile for any area of interest and reuse this function chain to work as a pixel editor. You’re not limited to changing the values of the pixels, you can use any of the functions that you want like filtering, statistics, band math, etc.

About the author

Kevin Butler is a Product Engineer on Esri’s Analysis and Geoprocessing Team working as a liaison to the science community. He holds a Ph.D. in Geography from Kent State University. Over the past decade he has worked on strategic projects, partnering with customers and other members of the science community to assist in the development of large ecological information products such as the ecological land units, ecological marine units and ecological coastal units. His research interests include a thematic focus on spatial statistical analytical workflows, a methodological focus on spatial clustering techniques and a geographic focus on Puerto Rico and midwestern cities.


Next Article

Monitor assignment status in ArcGIS Dashboards using a joined Workforce layer

Read this article