Edit Raster Function (Data Management)


Adds, replaces, or removes a function chain in a mosaic dataset or a raster layer that contains a raster function.


  • To apply the rft.xml to items in a mosaic dataset, you must select the items in the attribute table or define a query using the Make Mosaic Layer tool.

  • Database fragmentation and frequent data manipulation can dramatically increase the size of your mosaic dataset. If your database size is inflated due to constant transactions, run the Compact tool.


EditRasterFunction(in_mosaic_dataset, {edit_mosaic_dataset_item}, {edit_options}, {function_chain_definition}, {location_function_name})
ParameterExplanationData Type

The mosaic dataset or a raster layer. If you use a raster layer, it must have a function applied.

Mosaic Layer; Raster Layer

Determines if edits affect functions or the entire mosaic dataset.

  • EDIT_MOSAIC_DATASETEdits affect the functions associated with the mosaic dataset. This is the default.
  • EDIT_MOSAIC_DATASET_ITEMEdits affect the functions associated with all of the items within the mosaic dataset.

Insert, replace, or remove a function chain.

  • INSERTInsert the function chain above the Function Name of the existing chain. Specify the function chain in the location_function_name parameter. This is the default.
  • REPLACEReplace the existing function chain with the function chain specified in this tool. Specify the function chain below in the location_function_name parameter.
  • REMOVE Remove the function chain starting from the function specified in the location_function_name parameter.

Choose the function chain (rft.xml file) that you want to insert or replace.


Choose where to insert, replace, or remove the function chain within the existing function chain.


Derived Output

NameExplanationData Type

The updated mosaic dataset.

Mosaic Layer; Raster Layer

Code sample

EditRasterFunction example 1 (Python window)

This is a Python sample for EditRasterFunction.

import arcpy
     "C:/Workspace/editfunction.gdb/md", "EDIT_MOSAIC_DATASET", 
     "INSERT", "C:/workspace/hillshade.rft.xml", "Stretch Function")
EditRasterFunction example 2 (stand-alone script)

This is a Python script sample for EditRasterFunction.

#Add raster function on top of mosaic dataset

import arcpy
arcpy.env.workspace = "C:/Workspace"

mdname = "editfunction.gdb/md"
editmethod = "INSERT"
funcfile = "C:/workspace/hillshade.rft.xml"
funcname = "#"

arcpy.EditRasterFunction_management(mdname, editmode, editmethod, 
                                    funcfile, funcname)

Licensing information

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

Related topics