ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Editing function chain templates

  • Saving a function chain as a raster function template
  • Creating a new raster function template
  • Editing a raster function template

A raster function template contains a chain of functions and inputs as values or variables. The function template can then be added to a mosaic dataset, a mosaic dataset item, or a function raster layer to process pixels on-the-fly.

A function template not only contains raster functions, it also contains properties of the template:

  • Name—The template name.
  • Description—The description of the template.
  • Help—The help content that you want users to see when using this template.
  • Type—Indicates the template applied to a mosaic dataset, mosaic dataset items, or item groups specified in the Definition Query.
  • Group field name—The field name in the mosaic dataset that defines a group.
  • Tag field name—The field name in the mosaic dataset that contains the variable names used in the raster functions.

The Type property groups together items with the same GroupName and TagName. These two tags are normally used in (but not limited to) multidimensional mosaic datasets, where rasters with the same dimension values are considered one group, and tag names are normally the variable names used in the computation. For example, apply a function named P with a formula of V1 x V2 to each group in the mosaic dataset. Below is a list of function template properties:

  • Name—P
  • ...—Intermediate fields not shown here
  • Type—Item Group
  • Group field name—Group
  • Tag field name—Tag

Table showing the Group and Tag fields

Raster...GroupTagTime

Name1

a

v1

t1

Name2

a

v2

t1

Name3

b

v1

t2

Name4

b

v2

t2

This produces new items for each group, as shown below.

Table showing the new items produced

Raster...GroupTagTime

NewName1

a

P

t1

NewName2

b

P

t2

  • It can be loaded into a processing template when you add data to a mosaic dataset. Open the raster type properties, click the Functions tab, right-click a processing template, and click Load.
  • It can be used to edit the function chain in a mosaic dataset or its items using the Edit Raster Function tool or the Raster Function Editor Wizard.
  • It can be used to set the properties of the mosaic dataset when using Set Mosaic Dataset Properties or Set Raster Properties. These processing templates will be used to respond to requests from the processing template tab from the layer.

Saving a function chain as a raster function template

There are several locations where you have access to a function chain, such as:

  • On the Function tab on the Layer Properties dialog box.
  • On the Raster Function Editor opened from the Image Analysis window.
  • On the mosaic dataset.
  • On each raster within the mosaic dataset.

In all these locations (except on the mosaic dataset), you can export the function chain to a template.

  1. Access a function chain.
  2. Right-click the first item (Function chain item) under the Function Chain Function Chain and click Export As Template.

    The function chain opens in the Raster Function Template Editor.

  3. This template must be edited so you can apply it using other raster data, because in its current state, it is set up to work with the data in the function chain from which it was exported. For example, you need to set or clear some variables, such as the input raster datasets.
    1. Right-click the function pointing to a raster dataset and click Properties.
      Open function properties
    2. Click the Variable Manager tab, right-click the Raster variable row, and click Clear default value of Raster.
      Clear variable

      The TIFF file originally pointed to by this function is cleared.

    3. Save it or enter a variable name that applies to the data with which this template is used.

      For example, if you plan to use this template with a raster type, such as IKONOS, you can open the IKONOS raster type properties to see the variable names it uses and use them, such as MS, Dataset, or Pan.

      IKONOS raster variable names

      If you plan to use this template with the Raster Dataset raster type, the raster dataset variable name is Dataset.

      The variables that can be used include:

      • Dataset
      • Pan (short for pan-sharpened)
      • MS (short for multispectral)
      • Thermal
      • DEM
      • Pan-sharpened

      If you plan to use this template with the Table raster type and an associate table, where the table contains the file name and path to each raster dataset, you can enter @field.<field name> as the Variable Name.

      Table column heading variable

      If this raster function template publishes with an image service with the purpose of using the image service as the input data, the raster Variable Name must be Raster. For some functions, such as Slope or Hillshade, the default is DEM. You must change the Variable Name from DEM to Raster.

    4. You can also make changes to the other variables, such as setting a gamma value or pointing to a table field to define the value in the Stretch function. You can also modify these values on the Stretch tab so the same value is defined for every raster dataset.
  4. Click OK on the Raster Function Properties dialog box to save the changes to the variables.
  5. At the top of the chain, right-click Function Chain and click Set Help Info to add some useful information to this function chain to help you or others use it.

    Close the Function Template Help dialog box when finished.

  6. Click File > Save to save the raster function template.

Creating a new raster function template

  1. Click the Raster Function Template Editor button Raster Function Template Editor. For more information, see Adding a command to a toolbar.

    This opens a dialog box with a default function chain containing the Identity Function. As soon as you add a function, the default Identity Function disappears.

  2. Right-click Function Chain Function Chain and click Properties.
  3. Define the function template properties by right-clicking the function chain note and clicking Properties. You can define the following properties:
    • Name

    • Description

    • Help

    • Type

    • Group field name

    • Definition query

    • Tag field

  4. Enter a default number of bands in the Value column and click OK.
  5. Right-click the Identity Function or the Raster item in the chain, click Insert, then select a function from the list.
    Inserting a function

    The function is added above where you right-clicked.

    You can double-click the function to reopen it to modify its properties.

  6. Continue inserting functions to build the function chains you require.
  7. To add information to this function chain to help you or others use it, right-click Function Chain at the top of the chain, and click Set Help Info.

    Close the Function Template Help dialog box when finished.

  8. Click File > Save, navigate to a location to save the .rft.xml file, then click Save.
Note:
  • The functions will be applied from bottom to top. In the example below, the Band Arithmetic Function is applied first, then the Shaded Relief Function is applied, and the Clip Function is applied last.
    Example function chain
  • The function chain will not be validated as it is when you're editing it on a raster or mosaic dataset; therefore, you may accidentally chain together functions that will not work. For example, a chain can become invalid if one function requires a different number of bands than is output by the preceding function, such as applying the Grayscale function, which outputs one band, and following it with the NDVI function, which requires two bands. Therefore, the NDVI function cannot be applied, so the function chain cannot be applied, and the output image will be invalid.

Editing a raster function template

If you have an existing raster function template (*.rft.xml) file, you can open it in the Raster Function Template Editor and make modifications.

  1. Click the Raster Function Template Editor button Raster Function Template Editor (added to a toolbar from the Customize dialog box).

    This opens a dialog box with a default function chain.

  2. Click File > Open, navigate to and select a raster function template (*.rft.xml) file, then click Open.
  3. Make the modifications.
  4. Click File > Save.

Related Topics

  • Rasters with functions
  • What are the functions used by a raster or mosaic dataset?
  • Editing function chains in a mosaic dataset
  • Editing functions on a raster dataset
  • Edit Raster Function
  • Applying a function template
  • Populating functions with values from the attribute table
  • Accessing the Raster Function Template Editor
  • Saving a raster function template from the layer's symbology
  • Adding a processing template to a mosaic dataset
  • Adding raster data to a mosaic dataset using a custom template
  • Server-side processing with raster functions
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal