Convert Raster Function Template (Data Management)


Converts a raster function template between formats (rft.xml, json, and binary).


  • Raster function templates can be stored in XML, JSON, or binary format.

  • Since some formats work better on the web, you can convert your raster function template between formats. For example, you may want to convert your rft.xml function template to JSON so that you can use the template in an image service REST API.


ConvertRasterFunctionTemplate(in_raster_function_template, out_raster_function_template_file, {format})
ParameterExplanationData Type

The input raster function template file. The input template file can be XML, JSON, or binary format.

File; String

The output raster function template file path and file name.


The output function template file format.

  • XMLXML output format.
  • JSONJSON output format. This is the default.
  • BINARYBinary output format.

Code sample

ConvertRasterFunctionTemplate example 1 (Python window)

This is a Python sample for the ConvertRasterFunctionTemplate tool.

##Convert Raster Function Template

## Usage: ConvertRasterFunctionTemplate_management(in_raster_function_template,
##                   out_raster_function_template_file, {JSON | XML | BINARY})

import arcpy

#Convert rft.xml to json

arcpy.ConvertRasterFunctionTemplate_management("c:\\test\\NDVI.rft.xml", "C:\\Test\\json_NDVI.rft.json")
ConvertRasterFunctionTemplate example 2 (stand-alone script)

This is a Python script sample for the ConvertRasterFunctionTemplate tool.

#import arcpy module
import arcpy

#Set input parameters
in_json = "c:\\test\\aspect.json"
out_rftxml = "c:\\test\\aspect.rft.xml"
out_file_type = "XML"

#Convert json to rft.xml
arcpy.ConvertRasterFunctionTemplate_management(in_json, out_rftxml, out_file_type)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes