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.

This entry was posted in Imagery, Oceans & Maritime and tagged , , , . Bookmark the permalink.

Leave a Reply

2 Comments

  1. bamrashid says:

    What do you mean by “Navigate to the shapefile that you created for your area of interest”? does it mean you need to include the shapefile? because I was unable to insert the shapefile that I created earlier and “In the Editor window, add a Local Function above the Constant Function”, what do you mean by local function?

    • kevin_butler says:

      You should use the shapefile as the clipping geometry under clip extents. Local functions are a group of functions that work on a per-pixel basis. To access them, right click on the raster layer and select Local Function from the list.