Use mosaic dataset items in raster function templates

When working with multidimensional or similarly structured data, each raster or slice of data can be used as input to a raster function. While this can be done manually after adding them as layers to the map, it can be tedious when there are multiple inputs or multiple groups of inputs involved. A better solution is to organize your inputs or groups of inputs in a mosaic dataset, and attach a raster function template. When a raster function template is applied to the mosaic dataset, the inputs to the template can be items within the mosaic dataset.

In this scenario, mosaic dataset items need to be grouped logically, using group and tag fields, before they are passed into the template. Raster function templates applied to mosaic datasets need to work with minimal interaction. If your data is not grouped or tagged, you will need to define inputs to the template every time it is applied. Grouping and tagging is useful when working with multidimensional mosaic datasets.

To use items from a mosaic dataset in a raster function template, you'll set up the template first, attach that template to the mosaic dataset, and select the mosaic dataset items to use as inputs to the template. Once the mosaic dataset is added as a layer to a map, you can select the template to visualize your data.

Set up the raster function template to use individual items from a mosaic dataset

If you have a mosaic dataset that contains four raster datasets depicting slope, aspect, elevation, and hillshade, and you want to apply a processing template that uses all four of these surface datasets as inputs to a model, you need to set up your raster function template to use items from the mosaic dataset..

Add individual mosaic dataset items to a raster function template.

  1. Edit your raster function template properties to use items from your mosaic dataset.
    1. Identify the fields in your mosaic dataset attribute table that will be used as the Group Field Name and Tag Field Name. These can be fields that exist in your mosaic dataset, or you can create and populate fields. The Group Field Name references the field used to define the collection of rasters in your mosaic dataset that will be passed into the template. In the example above, State is used as the Group Field Name, where all rasters with the same State value will be passed to the template together. The Tag Field Name references the field that is used to identify each individual item within a group. In the example above, SurfaceType is used as the Tag Field Name.
    2. Open the raster function template properties dialog box by right-clicking a raster function template in the Raster Functions pane or clicking Edit Properties Properties in the Function Editor pane.
    3. Set the Type to Item Group on the Edit Properties dialog box. This configures the template to work on items in the mosaic dataset.
    4. Provide field names for Group Field Name and Tag Field Name.
      Set the Group Field Name and Tag Field Name parameters in the raster function template editor.
  2. Match the values from the tag field with the names of the inputs in your raster function template.
    1. Open the Function Editor pane for your raster function template.
    2. Right-click a function in the function chain and click Properties or double-click the function to open the properties dialog box for the function.
    3. Click the Variables tab to set the name of each variable input. In the example above, slope, elevation, aspect, and hillshade are used to identify the item in the mosaic dataset to use.
      Set the variable values to the values of the tag field for each raster function in the function template.
    4. Save the template when you're finished.

Set up the raster function template to use groups of items from a mosaic dataset

A similar workflow is used when a group of items from a mosaic dataset is used as input to a function that accepts a list of rasters. For example, if you pass all of the mosaic dataset items that show sea surface temperature (SST), over time, to the Cell Statistics function, statistics will be calculated from multiple rasters on a pixel-by-pixel basis.

Mosaic dataset attribute table showing date and the property being displayed in each raster.
  1. Open the raster function template properties dialog box by right-clicking a raster function template in the Raster Functions pane or clicking Edit Properties Properties in the Function Editor pane.
  2. Set Type to Item Group on the Edit Properties dialog box.
  3. Provide field names for Group Field Name and Tag Field Name. In the example above, Property is used as the group field such that all raster items displaying the same property, such as SST and ocean depth, are passed to the raster function. The Date field is the tag field.
  4. Open the Function Editor pane for your raster function template.
  5. Right-click a function in the function chain and click Properties or double-click the function to open the properties dialog box for the function.
  6. Click the Variables tab to set the name of the input rasters as Raster[]. This name notifies the function to process a list of grouped items.
    Cell Statistics Properties
  7. Save the template.

When you've finished setting up the template, you can attach the template to your mosaic dataset using the mosaic dataset template manager. Apply the template to the mosaic dataset; on the Data contextual tab, choose the arrow below the Processing Templates option.

Related topics