Custom raster functions

In addition to the raster functions that come with ArcGIS Pro, it is possible to create and apply custom functions. These functions are scripted in Python and applied using an option in the Raster Functions pane.


Although Python is used to write these functions, they are not compatible with ArcPy. They also cannot be used in geoprocessing models, which are incompatible with all raster functions.

There is a GitHub page devoted to the custom raster function community Custom raster function community. It includes all of the necessary documentation for creating custom functions and templates to get started. You can ask questions, download other users' functions, and upload functions to share with the community. There are three steps for applying a custom raster function in ArcGIS Pro:

  1. Open the options menu Menu and select Open Python Raster Function.
  2. Select the custom function file as the Python Module.
  3. Select the Class Name.

Custom raster functions can contain multiple sets of functions. You could have a single Python script with multiple functions in it. Think of these as layers. You could create a custom function with a layer for vegetation, another for a classified image, another that has a land/water mask, and so on. Each of these layers is known as a class. When you select the Class Name, only that function is applied.

Custom functions do not have to stand alone. They are designed to work with the other raster functions. If you want to add a custom function to a function chain that you are building in the Function Editor, use the Insert Python Raster Function button to insert your Python function into your function chain.

After creating a custom raster function, it can be deployed using the home folder. This allows you to distribute custom functions across the platform with minimal setup for users. For more information on deploying custom functions, see Python raster function deployment.

Related topics