ArcGIS Blog

Defense and Intelligence

Custom Image Processing 2.0

By kevin_butler

You can now use Python to create your own raster functions in ArcGIS. Previously, this was done in the .NET framework. Python is more accessible for users and allows you to plug into any of the Python libraries, such as SciPy. We’ve created a Github repository where you can learn about our API, download sample functions, contribute your own, and ask questions. The idea is to make this into a community for everyone who is creating custom raster functions for ArcGIS.

https://github.com/Esri/raster-functions/

Custom functions can be useful for anyone, but they’re especially powerful for the scientific community when working with HDF, Grib, or NetCDF files—what we call multidimensional mosaic datasets. A simple example of what you can do is to derive wind chill from a dataset that contains both wind speed and air temperature. You can also pull individual time slices for visualization and analysis.

There are some caveats, however. Python is not the same as ArcPy so this will not be compatible with geoprocessing models. If you want to know why, ask in the comments (it’s tangential to this topic). Whereas functions are ideal for per-pixel processing, if you want to do something that requires a global analysis, you’re better off with a geoprocessing model.

It’s technically true that anything you can do in Python, you can incorporate into a raster function; however, that doesn’t mean it’s a good idea. You want to stick with NumPy and SciPy for performance reasons because of their ability to handle rasters as an array.

Check out the repository. It has more background information on what a raster function is, and goes into much more detail about how to get started and optimize your custom raster functions. We’re leveling up here, so if you have any questions or need clarification on anything, you can ask questions on this blog or on the repository.

Share this article

Subscribe
Notify of
0 Comments
Oldest
Newest
Inline Feedbacks
View all comments