Make Mosaic Layer (Data Management)

Summary

Creates a mosaic layer from a mosaic dataset or layer file. The layer that is created by the tool is temporary and will not persist after the session ends unless the layer is saved as a layer file or the map is saved.

This tool can be used to make a layer so you can work with a specified subset of bands in a mosaic dataset.

Usage

  • The output can be created with only a subset of the bands. This will save time and disk space.

Parameters

LabelExplanationData Type
Mosaic Dataset

The path and name of the input mosaic dataset.

Mosaic Layer
Output Mosaic Layer

The name of the output mosaic layer.

Mosaic Layer
Expression
(Optional)

Define a query using SQL or use the Query Builder to build a query.

SQL Expression
Template Extent
(Optional)

The output extent can be specified by defining the four coordinates or by using the extent of an existing layer.

  • Current Display Extent Map View—The extent will be based on the active map or scene. This option is only available when there is an active map.
  • Draw Extent Square and Finish—The extent will be based on a rectangle drawn on the map or scene. This option will create a feature class in the project geodatabase and add a layer to the map. The feature class will have the same coordinate system as the map.
    Note:

    This option is not available in the Environments dialog box. It is only available from a tool parameter with an extent data type or from the Environments tab on a tool dialog box.

    Note:

    When the Enable and disable editing from the Edit tab editing option is checked, you must enable editing on the Edit ribbon tab to draw the extent.

  • Extent of a Layer Layer—The extent will be based on an active map layer. Use the drop-down list to choose an available layer or use the Extent of data in all layers option to get the combined extent of all active map layers, excluding the basemap. This option is only available when there is an active map with layers.

    Each map layer has the following options:

    • All Features Select All—The extent of all features in the layer.
    • Selected Features Area from Selected Features—The extent of the selected features in the layer.
    • Visible Features Extent Indicator—The extent of the visible features in the layer.
      Note:

      The extents from the Selected Features Area from Selected Features and Visible Features Extent Indicator options are only available for feature layers.

  • Browse Browse—The extent will be based on an existing dataset.
  • Clipboard Paste—The extent can be copied to and pasted from the clipboard.
    • Copy Extent Copy—Copies the extent coordinates and coordinate system to the clipboard.
    • Use Paste Extent Paste—Pastes the extent coordinates and, optionally, the coordinate system from the clipboard. If the clipboard values do not include a coordinate system, the extent will use the map’s coordinate system.
    Note:

    The extent coordinates are copied to and pasted from the clipboard using the same formatting and order as the ArcPy Extent object: x-min, y-min, x-max, y-max, and the spatial reference.

  • Reset Extent Reset—The extent will be reset to the default value.
  • Manually entered coordinates—The coordinates must be numeric values and in the active map's coordinate system.
    Caution:

    The map may use different display units than the entered coordinates. The use of a cardinal direction (N, S, E, W) is not supported. Use a negative value sign for south and west coordinates.

Extent
Bands
(Optional)

The bands that will be exported for the layer. If no bands are specified, all the bands will be used in the output.

Value Table
Mosaic Method
(Optional)

Choose the mosaic method. The mosaic method defines how the layer is created from different rasters in the mosaic dataset.

  • CLOSEST_TO_CENTERSorts rasters based on an order where rasters that have their center closest to the view center are placed on top.
  • NORTH_WESTSorts rasters based on an order where rasters that have their center closest to the northwest are placed on top.
  • LOCK_RASTEREnables a user to lock the display of single or multiple rasters, based on an ID or name. When you choose this option, you need to specify the Lock Raster ID.
  • BY_ATTRIBUTESorts rasters based on an attribute field and its difference from the base value. When this option is chosen, the order field and order base value parameters also need to be set.
  • CLOSEST_TO_NADIRSorts rasters based on an order where rasters that have their nadir position closest to the view center are placed on top. The nadir point can be different from the center point, especially in oblique imagery.
  • CLOSEST_TO_VIEWPOINTSorts rasters based on an order where the nadir position is closest to the user-defined viewpoint location and are placed on top.
  • SEAMLINECuts the rasters using the predefined seamline shape for each raster using optional feathering along the seams. The ordering is predefined during seamline generation. The LAST mosaic operator is not valid with this mosaic method.
String
Order Field
(Optional)

Choose the order field. When the mosaic method is BY_ATTRIBUTE, the default field to use when ordering rasters needs to be set. The list of fields is defined as those in the service table that are of type metadata.

String
Order Base Value
(Optional)

The order base value. The images are sorted based on the difference between this value and the attribute value in the specified field.

String
Lock Raster ID
(Optional)

The Raster ID or raster name to which the service should be locked so that only the specified rasters are displayed. If left undefined, it will be similar to the system default. Multiple IDs can be defined as a semicolon-delimited list.

String
Sort Order
(Optional)

Choose whether the sort order is ascending or descending.

  • ASCENDINGThe sort order will be ascending. This is the default.
  • DESCENDINGThe sort order will be descending.
String
Mosaic Operator
(Optional)

Choose the mosaic operator to use. When two or more rasters have the same sort priority, this parameter is used to further refine the sort order.

  • FIRSTThe first raster in the list will be on top. This is the default.
  • LASTThe last raster in the list will be on top.
  • MINThe raster with the lowest value will be on top.
  • MAXThe raster with the highest value will be on top.
  • MEANThe average pixel value will be on top.
  • BLENDThe output cell value will be a blend of values; this blend value relies on an algorithm that is weight based and dependent on the distance from the pixel to the edge within the overlapping area.
  • SUMThe output cell value will be the aggregate of all overlapping cells.
String
Output Cell Size
(Optional)

The cell size of the output mosaic layer.

Double
Processing Template
(Optional)

The raster function processing template that can be applied on the output mosaic layer.

  • NoneNo processing template.
String

arcpy.management.MakeMosaicLayer(in_mosaic_dataset, out_mosaic_layer, {where_clause}, {template}, {band_index}, {mosaic_method}, {order_field}, {order_base_value}, {lock_rasterid}, {sort_order}, {mosaic_operator}, {cell_size}, {processing_template})
NameExplanationData Type
in_mosaic_dataset

The path and name of the input mosaic dataset.

Mosaic Layer
out_mosaic_layer

The name of the output mosaic layer.

Mosaic Layer
where_clause
(Optional)

Define a query using SQL.

SQL Expression
template
(Optional)

The output extent can be specified by defining the four coordinates or by using the extent of an existing layer.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
band_index
[ID,...]
(Optional)

The bands that will be exported for the layer. If no bands are specified, all the bands will be used in the output.

Value Table
mosaic_method
(Optional)

Choose the mosaic method. The mosaic method defines how the layer is created from different rasters in the mosaic dataset.

  • CLOSEST_TO_CENTERSorts rasters based on an order where rasters that have their center closest to the view center are placed on top.
  • NORTH_WESTSorts rasters based on an order where rasters that have their center closest to the northwest are placed on top.
  • LOCK_RASTEREnables a user to lock the display of single or multiple rasters, based on an ID or name. When you choose this option, you need to specify the Lock Raster ID.
  • BY_ATTRIBUTESorts rasters based on an attribute field and its difference from the base value. When this option is chosen, the order field and order base value parameters also need to be set.
  • CLOSEST_TO_NADIRSorts rasters based on an order where rasters that have their nadir position closest to the view center are placed on top. The nadir point can be different from the center point, especially in oblique imagery.
  • CLOSEST_TO_VIEWPOINTSorts rasters based on an order where the nadir position is closest to the user-defined viewpoint location and are placed on top.
  • SEAMLINECuts the rasters using the predefined seamline shape for each raster using optional feathering along the seams. The ordering is predefined during seamline generation. The LAST mosaic operator is not valid with this mosaic method.
String
order_field
(Optional)

Choose the order field. When the mosaic method is BY_ATTRIBUTE, the default field to use when ordering rasters needs to be set. The list of fields is defined as those in the service table that are of type metadata.

String
order_base_value
(Optional)

The order base value. The images are sorted based on the difference between this value and the attribute value in the specified field.

String
lock_rasterid
(Optional)

The Raster ID or raster name to which the service should be locked so that only the specified rasters are displayed. If left undefined, it will be similar to the system default. Multiple IDs can be defined as a semicolon-delimited list.

String
sort_order
(Optional)

Choose whether the sort order is ascending or descending.

  • ASCENDINGThe sort order will be ascending. This is the default.
  • DESCENDINGThe sort order will be descending.
String
mosaic_operator
(Optional)

Choose the mosaic operator to use. When two or more rasters have the same sort priority, this parameter is used to further refine the sort order.

  • FIRSTThe first raster in the list will be on top. This is the default.
  • LASTThe last raster in the list will be on top.
  • MINThe raster with the lowest value will be on top.
  • MAXThe raster with the highest value will be on top.
  • MEANThe average pixel value will be on top.
  • BLENDThe output cell value will be a blend of values; this blend value relies on an algorithm that is weight based and dependent on the distance from the pixel to the edge within the overlapping area.
  • SUMThe output cell value will be the aggregate of all overlapping cells.
String
cell_size
(Optional)

The cell size of the output mosaic layer.

Double
processing_template
(Optional)

The raster function processing template that can be applied on the output mosaic layer.

  • NoneNo processing template.
String

Code sample

MakeMosaicLayer example 1 (Python window)

This is a Python sample for MakeMosaicLayer.

arcpy.MakeMosaicLayer_management(
        "fgdb.gdb/mdsrc", "mdlayer2", "", "clipmd.shp", "3;2;1", 
		"BY_ATTRIBUTE", "Tag", "Dataset", "", "DESCENDING", "LAST", "10", 
		processing_template="NDVI")
MakeMosaicLayer example 2 (Python window)

This is a Python script sample for MakeMosaicLayer.

arcpy.MakeMosaicLayer_management(
        "fgdb.gdb/mdsrc", "mdlayer2", "", "clipmd.shp", "3;2;1", 
		"BY_ATTRIBUTE", "Tag", "Dataset", "", "DESCENDING", "LAST", "10", 
		processing_template="Custom_func")