Server-side processing with raster functions

Image services support server-side processing through some default functions that are supported through REST, but also by publishing image services and associated raster function templates that can be accessed and used via REST and ArcGIS for Desktop applications, such as ArcMap.

To implement the raster function template (.rft.xml), you must first create it using the Raster Function Template Editor, then add the .rft.xml file to the image service when it is published. When publishing the .rft.xml file with an image service, the functions defined within a raster function template can be applied only to the contents within an image service. The template cannot use data from another input.

Using REST to perform server-side processing on image services is very useful when creating web applications that offer image services processed using different methods, or when applications cannot perform the processing. For example:

REST supports basic functions on image services, including aspect, color map, NDVI, slope, shaded relief, hillshade, statistics, and stretch. But you can extend these capabilities by publishing an image service with an .rft.xml file where you can chain the raster functions together to create the processing result you need.

Applying raster function templates to an image service containing functions, such as stretch, is useful when the image services will be used in web applications. Web applications are often unable to enhance imagery; therefore, they rely on server-side processing. In this situation, when you add a raster function template to the image service, you can choose to apply it by default.

TipTip:

You can add your image to ArcMap, modify it's symbology (including the stretch) and export the settings to a raster function template. To learn about this, see Saving a raster function template from the layer's symbology.

Accessing the Raster Function Template Editor

The Raster Function Template Editor button is added from the Customize dialog box.

Steps:
  1. In ArcMap, click the Customize menu and click Customize Mode.
  2. Click the Commands tab.
  3. In the Categories list, scroll down and click Raster.
  4. From the Commands list, drag and drop the Raster Function Template Editor Raster Function Template Editor item onto any toolbar.
  5. Click Close.
    TipTip:

    To remove the button from the toolbar, open the Customize dialog box, click the Raster Function Template Editor button Raster Function Template Editor, drag and drop it off the toolbar, then close the Customize dialog box.

  6. Click the Raster Function Template Editor button Raster Function Template Editor to open it.

Creating the raster function template

You can create a raster function template from any location where you have access to a function chain by exporting it to a template, or you can create one within the Raster Function Template Editor.

Steps:
  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 containing the Identity Function. As soon as you add a function, the default Identity Function will disappear.

  2. Right-click Function Chain Function Chain and click Settings.
  3. Enter a default number of bands in the Value column and click OK.
  4. Right-click the Identity Function or the Raster item in the chain, click Insert, and 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.

  5. Continue inserting functions to build the function chain you require.
  6. 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.

  7. Click File > Save and navigate to a location to save the .rft.xml file, then click Save.
NoteNote:
  • The function chain can only be applied to the contents within an image service. It cannot use data from another input.
  • 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 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 1 band, and following it with the NDVI function, which requires 2 bands. Therefore, the NDVI function cannot be applied, so the function chain cannot be applied, and the output image will be invalid.

Configuring an image service to use a raster function template

You add the .rft.xml files to the image service when you configure the parameters for it before publishing.

Steps:
  1. If the image service is published and running, stop it.
  2. Access the image service properties.
  3. From the left menu of the Service Editor dialog box, click Function.
  4. Click the Manage button to open the Manage Raster Function Templates dialog box.
  5. Add one or more .rft.xml files to the list.
  6. Optionally, choose a raster function template to apply by default by selecting it in the Default drop-down menu.
  7. Click OK to close the dialog boxes.
  8. Publish the image service.

Related Topics

9/1/2015