With Custom Python Raster Functions in ArcGIS Enterprise on Kubernetes, organizations can integrate their own Python-based raster processing directly into ArcGIS raster analytics workflows. Rather than moving data outside the platform or maintaining separate processing pipelines, developers can package custom raster functions and use them alongside Esri-provided raster functions.
Organizations working with imagery and raster analytics often encounter specialized processing requirements that go beyond the capabilities of standard raster functions. Whether you’re implementing a proprietary scientific algorithm, an industry-specific workflow, or a custom machine learning model, flexibility is essential.
Why use Custom Python Raster Functions?
ArcGIS provides more than 150 built-in raster functions covering image enhancement, spectral analysis, terrain analysis, multidimensional processing, change detection, and much more. While these functions address many common workflows, every organization has unique analytical needs.
Custom Python Raster Functions allow you to:
- Implement proprietary or domain-specific algorithms.
- Reuse existing Python raster processing code.
- Standardize custom analysis across your organization.
- Integrate custom processing into raster function chains and Raster Function Templates.
- Scale processing using Raster Analytics in ArcGIS Enterprise on Kubernetes.
Rather than treating custom code as a separate processing step, your algorithms become first-class citizens within the ArcGIS imagery workflow.
What Makes This Feature Exciting?
One of the biggest advantages is that users no longer need to execute standalone Python scripts outside of ArcGIS. Once registered, a custom raster function behaves similarly to built-in raster functions and can be incorporated into existing imagery workflows.
This means your organization can:
- Build once and reuse across projects and teams.
- Share analytical workflows across teams.
- Execute custom processing using the distributed Raster Analytics infrastructure.
- Maintain consistent processing across projects.
For organizations already leveraging ArcGIS Enterprise on Kubernetes, this provides a straightforward way to extend the platform without modifying core system components.
Packaging Your Custom Function
A custom raster function package is intentionally simple.
Each deployment package contains:
- A Python script (.py) containing your raster processing logic.
- A Raster Function Template (.rft.xml) describing how ArcGIS should invoke the function.
- A ZIP package containing the required directory structure.
ArcGIS defines required naming conventions and directory requirements to ensure the platform can correctly locate and execute your custom function after deployment.
Register Once, Use Everywhere
Beginning with ArcGIS Enterprise 11.5, administrators can register custom Python raster functions through the Administrator API.
After registration:
- The function becomes available as a Portal item.
- It can be discovered by users.
- It can be incorporated into Raster Function Templates.
- It can be used in raster analysis workflows just like built-in raster functions.
This centralized deployment model makes it much easier to distribute custom analytical capabilities across an enterprise environment.
Example: Tree Crown Health
To demonstrate the workflow, let’s look at an example from the U.S. Forest Service (USFS). In this example, a custom Python raster function is used to generate tree crown health maps from aerial imagery.
This workflow illustrates how organizations can package their own image analysis algorithms and execute them at scale using ArcGIS Enterprise on Kubernetes.
The following example demonstrates how a custom Python raster function can be deployed and executed using Raster Analytics.
The Challenge
Tree health assessment often relies on specialized algorithms developed by organizations or research groups. While these algorithms can be implemented as Python raster functions, deploying and managing them across an enterprise environment—particularly on Kubernetes—has traditionally required significant manual effort.
With the new Custom Python Raster Function capability, administrators can register these algorithms once and make them available throughout the organization.
Preparing the Custom Raster Function
A custom Python raster function consists of two primary components:
- Raster Function Template (.rft.xml) that defines the raster function and its parameters.
- Python script (.py) that implements the image processing algorithm.
For the USFS example, these files are packaged together into a single ZIP archive that will be uploaded during registration.
Registering the Function
Because custom code will be executed within the Raster Analytics environment, administrator privileges are required to register a custom Python raster function.
Using the new Custom Python Raster Function administrative API, an administrator simply uploads the ZIP package containing the raster function template and Python script.
During registration, ArcGIS Enterprise validates the package structure and metadata before creating the associated Portal item.
Once registration is complete:
- The custom raster function becomes a Portal item.
- It is available throughout the organization.
- It can be discovered and reused like any built-in raster function.
Using the Registered Function
After registration, the custom raster function is available as an item in the portal and can be accessed from Raster Function Templates within Map Viewer.
From the user’s perspective, a registered custom Python raster function can be used in workflows alongside ArcGIS-provided raster functions. The function can be:
- Opened and edited
- Combined with built-in raster functions
- Included in Raster Function Templates
- Shared across projects
In this example, the Tree Crown Health raster function is chained together with the Attribute Table raster function to produce an improved visualization with a customized color scheme.
Running the Analysis
The Tree Crown Health function accepts:
- A three-band NAIP image
- A tree mask identifying vegetation areas
When the analysis is submitted, ArcGIS Enterprise distributes the custom raster function package to the Raster Analytics worker nodes running in Kubernetes, where the Python code is executed as part of the analysis workflow.
Each worker executes the Python code as part of the Generate Raster operation, allowing the processing to scale across the Kubernetes cluster for large imagery datasets.
The resulting output is a tree crown health map that visually identifies tree condition across the input imagery.
Best Practices
When creating custom raster functions, consider the following recommendations:
- Design functions to be modular and reusable.
- Keep dependencies minimal whenever possible.
- Validate input parameters before processing.
- Follow the required file naming and directory conventions.
- Test locally before deploying to your enterprise environment.
- Package related functionality into reusable Raster Function Templates.
- Document parameter requirements and expected inputs to simplify adoption by other users.
These practices help simplify deployment and improve maintainability across environments.
Security considerations
Because custom raster functions execute user-provided Python code, only trusted administrators should be allowed to register packages. Organizations should follow internal code review and governance processes before deploying custom functions into production environments.
Unlock New Analytical Possibilities
Custom Python Raster Functions bridge the gap between out-of-the-box raster processing and organization-specific innovation.
Instead of adapting your workflows to fit existing tools, you can now bring your own algorithms directly into ArcGIS Enterprise on Kubernetes. Once deployed, they become reusable building blocks that integrate naturally with existing raster functions, enabling scalable, repeatable, and enterprise-ready imagery analysis.
Whether you’re implementing advanced scientific models, proprietary business logic, or cutting-edge image analysis techniques, Custom Python Raster Functions provide a powerful extension point for the ArcGIS raster analytics platform.
The result is a more flexible, extensible, and scalable imagery analysis environment—one that empowers organizations to transform their own expertise into reusable enterprise capabilities.
Article Discussion: