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.
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 and click Save; this will save an rft.xml file.
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.
Syntax
arcpy.management.EditRasterFunction(in_mosaic_dataset, {edit_mosaic_dataset_item}, {edit_options}, {function_chain_definition}, {location_function_name})
Parameter | Explanation | Data 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.
| Boolean |
edit_options (Optional) | Insert, replace, or remove a function chain.
| 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
Name | Explanation | Data 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)
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes