Edit Raster Function (Data Management)

Summary

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

Usage

  • 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 significantly increase the size of a mosaic dataset. If the database size is large due to constant transactions, run the Compact tool.

Parameters

LabelExplanationData Type
Input Raster

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

Mosaic Layer; Raster Layer
Mosaic Dataset Items
(Optional)

Applies the function chain to every item in the mosaic dataset individually or to the mosaic dataset as a whole.

  • Unchecked—Edits affect the functions associated with the mosaic dataset. This is the default.
  • Checked—Edits affect the functions associated with all of the items within the mosaic dataset.
Boolean
Edit Options
(Optional)

Insert, replace, or remove a function chain.

  • INSERTInsert the function chain above the Function Name of the existing chain. Specify the function chain below in the 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 Function Name parameter.
  • REMOVE Remove the function chain starting from the function specified in the Function Name parameter.
String
Raster Function Template
(Optional)

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

File
Function Name
(Optional)

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

If you Insert the function, it will be inserted above the function specified in the Function Name parameter.

String

Derived Output

LabelExplanationData Type
Updated Dataset

The updated mosaic dataset.

Mosaic Layer; Raster Layer

arcpy.management.EditRasterFunction(in_mosaic_dataset, {edit_mosaic_dataset_item}, {edit_options}, {function_chain_definition}, {location_function_name})
NameExplanationData Type
in_mosaic_dataset

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

Mosaic Layer; Raster Layer
edit_mosaic_dataset_item
(Optional)

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.
Boolean
edit_options
(Optional)

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.
String
function_chain_definition
(Optional)

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

File
location_function_name
(Optional)

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

String

Derived Output

NameExplanationData Type
out_raster

The updated mosaic dataset.

Mosaic Layer; Raster Layer

Code sample

EditRasterFunction example 1 (Python window)

This is a Python sample for EditRasterFunction.

import arcpy
arcpy.EditRasterFunction_management(
     "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"
editmode = "EDIT_MOSAIC_DATASET"
editmethod = "INSERT"
funcfile = "C:/workspace/hillshade.rft.xml"
funcname = "#"

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