In this tutorial, you'll learn how to build a raster function template (RFT) in ArcGIS Pro to support a processing workflow for assessing vegetation coverage and relative health.
The Sacramento National Wildlife Refuge provides critical refuge and breeding habitat for migratory birds and other wildlife and manages endangered, threatened, and sensitive species. The refuge also serves to alleviate crop damage from wildlife along the Sacramento River valley.
In this tutorial, you'll use raster functions to investigate the coverage and health of natural vegetation and crops around the wildlife refuge, which helps the refuge balance the requirements of natural wildlife and agricultural land use.
Add the tutorial data to your ArcGIS Pro project
The data packaged for this tutorial includes a subsection from a Landsat 8 scene collected on June 8, 2018.
- Download the tutorial data, save it to your machine, and unzip the files.
- In ArcGIS Pro, create a project using the Map template and sign in to your ArcGIS Online account.
- Set up your project:
- On the Map tab, click the Basemap drop-down and select Imagery.
This replaces the default basemap with world imagery.
- On the Insert tab, click Add Folder, and browse to the folder where you saved the tutorial data. Select the folder and click OK.
- On the View tab, click Catalog pane.
- On the Map tab, click the Basemap drop-down and select Imagery.
- In the Catalog pane, expand Folders to view the tutorial data. Right-click the L8_SactoCA_6_8_18.tif raster dataset and select Add to Current Map.
Visualize the raster
The raster layer in the Contents pane controls how ArcGIS Pro visualizes the source data (accessible in the Catalog pane).
Band combinations (or more complicated chains of functions) are applied to the source data in memory. This means that processing results are quickly rendered on the fly as you pan and zoom. It also means that there is no need to store or manage intermediate processing results.
Explore the raster layer and change the band combination used to render the image.
- In the Contents pane, right-click the L8_SactoCA_6_8_18.tif layer and select Properties.
- In the Layer Properties dialog box, select Source and view the detailed raster information, raster metadata, band metadata, image statistics, extent, and spatial reference information. All of these image file properties are derived from the source Landsat 8 metadata.
- Close the Layer Properties dialog box when you’re finished.
- Change the band combination used to display the image from natural color to color infrared:
- Select the L8_SactoCA_6_8_18.tif layer in the Contents pane.
- On the Appearance tab in the Raster Layer group, click the Band Combination drop-down arrow and select Color Infrared to change the band combination.
Your raster looks similar to the following:
Use a raster function to compute the vegetation index
Next, you will apply a raster function to the image to calculate a vegetation index to delineate areas of dense, healthy vegetation.
- Click the raster layer in the Contents pane to activate it. On the Imagery tab, click Raster Functions.
- In the search box, type band, and click the Band Arithmetic raster function in the results. The Band Arithmetic dialog box appears.
You can click the information button on the Band Arithmetic dialog box to display the function help. Many types of out-of-the-box vegetation indexes are described, or you can create a custom index using this function.
- Set the parameters for the Band Arithmetic function:
- Raster-Click the drop-down arrow and select L8_SactoCA_6_8_18.tif.
- Method-Click the drop-down arrow and select SAVI.
- Band Indexes-Type 5 4 0.33, which are the band numbers for the Landsat 8 near infrared and red bands and an estimate of the SAVI value for green vegetation cover.
- Click Create new layer.
The resulting single-band SAVI layer is loaded into the Contents pane and displayed in the map viewer. The name of the applied raster function is a prefix to the source data file name; in this case, it is Band Arithmetic_L8_SactoCA_6_8_18.tif.
The source data is 32-bit floating point format, but it is scaled to 8-bit for display.
Bright areas exhibit full vegetation coverage and high relative vigor. Dull or dark areas exhibit nonvegetated areas such as bare soil or water bodies.
If the result is a solid gray block, select the layer in the Contents pane, open the Appearance tab on the main ribbon, and select DRA from the Rendering group.
- Pan and zoom to explore the SAVI results layer. You can visually identify the areas that show up as healthy, dense vegetation. Notice that the raster layer is rendered on the fly, and the original source data has not been copied or altered.
Chain together functions to classify vegetation
Now, you’ll chain together multiple functions to group your results into four categories for interpretation.
- In the Raster Function pane, in the search box, type remap, and click the Remap raster function in the results.
- Set the parameters to remap the values of the layer:
- Raster—Click the drop-down arrow and select Band Arithmetic_L8_SactoCA_6_8_18.tif.
- Remap Definition Type—Choose List to manually list the categories.
- Fill in the list using the following values:
- Check the Change Missing Values to NoData check box.
- Click Create New Layer.
The resulting single-band raster shows categorical data on a scale from 1 through 4, where 1 represents areas with very low SAVI values, indicating little to no vegetation, and 4 represents high SAVI values or dense, healthy vegetation.
- Click the name of the layer in the Contents pane and rename it SAVI_Classified.
- Select the layer in the Contents pane. On the Appearance tab, click the Symbology button to open the Symbology pane.
- Set the parameters to symbolize the classified SAVI layer:
- Click the Primary symbology drop-down arrow and select Classify as the symbology type. Choose Yes to compute the histogram.
- Method—Select Equal Interval.
- Classes—Select 4.
- Edit the symbology table to match the image below. Click each color chip to change the colors to a more appropriate color scheme. You can also change the label to be easier to interpret.
Your map looks similar to the following:
Review and export the raster function chain
You can view the chain of functions applied to a layer, modify their parameters, and add functions using the Raster Function Editor.
- To review the chain of functions used to accomplish this result, right-click the SAVI_Categorized layer in the Contents pane and select Edit Function Chain.
- Double-click the Remap function to see the parameters you set earlier. Click Cancel to close.
- Save the raster function template by selecting the functions you want in your processing chain (press Ctrl and click each function or select by rectangle in rubber band mode). Right-click one of the selected functions and choose Export as Template.
A new raster function editor window appears and the raster function chain is loaded.
- Delete the raster variable at the beginning of the function chain.
- Double-click the Band Arithmetic function. Click the Variables tab and check the IsPublic check box next to Raster, and click OK.
- Click Save As to save the raster function processing chain as an .rft file. Name it SAVI_Classified and click OK.
- In the Raster Functions pane, select Custom. Click your new RFT. The tool now prompts you to select a raster so you can apply your processing workflow to another Landsat 8 scene.
Up to this point in your image processing workflow, all the processing has been done in-memory. You can optionally persist the results to disk. To do this, right-click the layer in the Contents pane, select Data > Export Raster, and configure as desired.
In this tutorial, you learned how ArcGIS Pro uses dynamic in-memory processing to quickly render rasters as you pan and zoom. You also learned how to apply raster functions to your image, chain them together to create more complex processing workflows, and save the function chain as a raster function template that you can apply to other rasters in the future.