Label | Explanation | Data Type |
Output Raster Collection
| The full path of the mosaic dataset to be created. The mosaic dataset must be stored in a geodatabase. | Mosaic Dataset |
Collection Builder
| The input image collection. It can be seen as a template that contains arguments such as the source mosaic dataset path, filters to extract a subset from the input data source, and so on. Currently, this tool only supports Simple Collection, which allows you to define a single data source and a query filter, for the data source.
| String |
Collection Builder Arguments
| The list of arguments to create a subset collection of the mosaic dataset. This tool only supports the data source and filter to subset the mosaic dataset. The Data Source and Where Clause values must be completed, otherwise the tool cannot be executed.
| Value Table |
Input Raster Function
(Optional) | The path to a raster function template file (.rft.xml or .rft.json). The raster function template will be applied to every item in the input mosaic dataset. The Function Editor can be used to create the template. If no RFT is defined, this tool will create the output mosaic based on the Collection Builder Arguments parameter. | String; File |
Raster Function Arguments
(Optional) | The parameters associated with the function chain. For example, if the function chain applies the NDVI function, set the visible and infrared IDs. The raster variable name of the RFT should be the Tag field value in the input data source. | Value Table |
Raster Collection Properties
(Optional) | The output mosaic dataset key properties. The key metadata properties that are available is based on the type of sensor that captured the imagery. Some examples of key metadata properties include the following:
| Value Table |
Generate Rasters
(Optional) | Generate raster dataset files of the mosaic dataset items, after the application of the RFT.
| Boolean |
Output Raster Workspace
(Optional) | Defines the output location for the persisted raster datasets, if the Generate Rasters parameter is checked on. The naming convention for the output raster files is oid_<oid#>_<Unique_GUID>. | Folder; String |
Format (Optional) | The format type of the raster to be generated.
| String |
Output Base Name (Optional) | Defines the output base name of the persisted raster datasets, if the Generate Rasters parameter is checked on. Multiple raster dataset outputs will have a number alias appended to their base name. The resulting mosaic dataset will reference the CRF directly without maintaining the raster function chain. | String |
Summary
Performs batch analysis or processing on image collections contained in a mosaic dataset. The images in the input mosaic dataset can be processed individually or as groups.
The rules of processing can be defined through the Collection Builder parameter and raster function parameters. It generates a new mosaic dataset of processed images. You can optionally choose to save the processed images to disk as separate files. The default condition is to append the input raster function to the mosaic dataset's existing images' function chain, and add it to the output mosaic dataset.
Usage
The output of this tool is a mosaic dataset with the raster function template (RFT) applied to each raster item. Since the optional parameters affect the output, you need to properly define the parameters in order to obtain the correct output.
If you want to generate separate image files with an RFT applied, you must define an output workspace. An RFT can be created using the Raster Function Editor.
Parameters
arcpy.management.GenerateRasterCollection(out_raster_collection, collection_builder, collection_builder_arguments, {raster_function}, {raster_function_arguments}, {collection_properties}, {generate_rasters}, {out_workspace}, {format}, {out_base_name})
Name | Explanation | Data Type |
out_raster_collection | The full path of the mosaic dataset to be created. The mosaic dataset must be stored in a geodatabase. | Mosaic Dataset |
collection_builder | The input image collection. It can be seen as a template that contains arguments such as the source mosaic dataset path, filters to extract a subset from the input data source, and so on. Currently, this tool only supports SIMPLE_COLLECTION, which allows you to define a single data source and a query filter for the data source.
| String |
collection_builder_arguments [[Name, Value],...] | The list of arguments to create a subset collection of the mosaic dataset. This tool only supports the data source and filter to subset the mosaic dataset. The DataSource and WhereClause values must be completed, otherwise the tool cannot be executed.
| Value Table |
raster_function (Optional) | The path to a raster function template file (.rft.xml or .rft.json). The raster function template will be applied to every item in the input mosaic dataset. The Function Editor can be used to create the template. If no RFT is defined, this tool will create the output mosaic based on the collection_builder_arguments parameter. | String; File |
raster_function_arguments [[Name, Value],...] (Optional) | The parameters associated with the function chain. For example, if the function chain applies the NDVI function, set the visible and infrared IDs. The raster variable name of the RFT should be the Tag field value in the input data source. | Value Table |
collection_properties [[Name, Value],...] (Optional) | The output mosaic dataset key properties. The key metadata properties that are available is based on the type of sensor that captured the imagery. Some examples of key metadata properties include the following:
| Value Table |
generate_rasters (Optional) | Choose to generate raster dataset files of the mosaic dataset items, after the application of the RFT.
| Boolean |
out_workspace (Optional) | Defines the output location for the persisted raster datasets, if the generate_rasters parameter is set to GENERATE_RASTERS. The naming convention for the output raster files is oid_<oid#>_<Unique_GUID>. | Folder; String |
format (Optional) | The format type of the raster to be generated.
| String |
out_base_name (Optional) | Defines the output base name for the persisted raster datasets, if the generate_rasters parameter is set to GENERATE_RASTERS. | String |
Code sample
This is a Python script for the GenerateRasterCollection tool.
import arcpy
arcpy.GenerateRasterCollection_management(
out_raster_collection="c:/temp/FGDB.gdb/testgencollection",
collection_builder="Simple Collection",
collection_builder_arguments="# DataSource c:\temp\FGDB.gdb\qb_portland;#
WhereClause 'Tag = 'MS''",
raster_function="C:/temp/NDVI_test.rft.json",
raster_function_arguments="# MS #;# VisibleBandID_20171019_7337_958 1;#
InfraredBandID_20171019_7337_958 4",
collection_properties="",
generate_rasters="GENERATE_RASTERS",
out_workspace="c:/temp/persistedoutput",
format="CRF"
)