Create a Math Function Raster dataset


PurposeThis topic shows how to create a Math Function Raster dataset combining multiple operations together into a complex equation. It opens the raster datasets, applies two Math Function Raster operations (adding two rasters together, then dividing by a third raster) and saves the created Function Raster dataset to the specified file.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Start Visual Studio and open the solution file.
  2. Edit the strings in the "Specify input directory and dataset name" region to specify the directory and name of the input dataset, and the full path to the output dataset including the .afr extension.
  3. Compile and run the program.
  4. If the program succeeds, the console shows a "Success" message. If an error occurs, it shows on the console window.
  5. Load the created output .afr file into ArcMap or ArcCatalog, which reflects the processing results.

CreateMathFunctionRasterDataset.cs Main source file that contains the components of the sample, including licensing code.
Download the C# files
CreateMathFunctionRasterDataset.vb Main source file that contains the components of the sample, including licensing code.
Download the VB.NET files

Download the files for all languages

See Also:

Sample: Create a Function Raster dataset




Development licensing Deployment licensing
ArcGIS for Desktop Advanced: Spatial Analyst ArcGIS for Desktop Advanced: Spatial Analyst
ArcGIS for Desktop Standard: Spatial Analyst ArcGIS for Desktop Standard: Spatial Analyst
ArcGIS for Desktop Basic: Spatial Analyst ArcGIS for Desktop Basic: Spatial Analyst