Edit Raster Function (Data Management)
Summary
Adds, replaces, or removes a raster function template to a mosaic dataset, items in a mosaic dataset, or a raster layer that contains a raster function. A raster function template defines a raster function chain. The template is stored as an rft.xml file, which can be exported from the Raster Function Editor.
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.
The Raster Function Template Editor tool can be added to any toolbar using the Customized Mode window. The tool is located under the Command tab within the Raster category. To save out a raster function template, click File, then click Save; this will save an rft.xml file.
Database fragmentation and frequent data manipulation may increase the size of your mosaic dataset dramatically. If your database size is inflated due to constant transactions, you should run the Compact tool.
Syntax
Parameter | Explanation | Data Type |
in_mosaic_dataset |
The input can be a mosaic dataset or a raster layer that contains a raster function. | Mosaic Layer; Raster Layer |
edit_mosaic_dataset_item (Optional) | Choose whether to edit the mosaic dataset items.
| Boolean |
edit_options (Optional) |
Choose whether to insert a new raster function, replace an existing raster function chain, or remove the existing one.
| String |
function_chain_definition (Optional) |
The raster function template file (rft.xml). A raster function chain can be exported from the Raster Function Template Editor. | File |
location_function_name (Optional) | The name of the function where the edits will take place. If you INSERT the function, then it will be inserted above the location_function_name. If you REPLACE the function, then it will replace the function that has been selected. If you REMOVE the function, then it will remove the function that has been selected. | String |
Code Sample
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")
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)