Make Mosaic Layer (Data Management)


Creates a temporary mosaic layer from an 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 to disk or the map document is saved.

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



MakeMosaicLayer_management (in_mosaic_dataset, out_mosaic_layer, {where_clause}, {template}, {band_index}, {mosaic_method}, {order_field}, {order_base_value}, {lock_rasterid}, {sort_order}, {mosaic_operator})
ParameterExplanationData Type

The path and name of the input mosaic dataset.

Mosaic Layer

The name of the temporary output mosaic layer.

Mosaic Layer

A query statement using the fields and values of the mosaic dataset.

SQL Expression

Using the min x, min y, max x, or max y, you can specify the extents of the output mosaic layer.


Choose which bands to export for the layer. If no bands are specified, then all the bands will be used in the output.

Value Table

Choose the mosaic method. The mosaic method defines how the layer is created from different rasters within 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.

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.


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


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


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.

Choose which mosaic operator to use. When two or more rasters all 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 lowest 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.

Code Sample

MakeMosaicLayer example 1 (Python window)

This is a Python sample for MakeMosaicLayer.

import arcpy
from arcpy import env
env.workspace = "C:/Workspace"
arcpy.MakeMosaicLayer_management("fgdb.gdb/mdsrc", "mdlayer2", "", \
                                 "clipmd.shp", "3;2;1", "BY_ATTRIBUTE",\
                                 "Tag", "Dataset", "", "DESCENDING", "LAST")
MakeMosaicLayer example 2 (stand-alone script)

This is a Python script sample for MakeMosaicLayer.

#Make Mosaic Layer
#Usage: MakeMosaicLayer_management in_mosaic_dataset out_mosaic_layer {where_clause} {template} 
#                                  {ID;ID...} {mosaic_method} {order_field} {order_base_value} 
#                                  {lock_rasterid} {ASCENDING | DESCENDING} {FIRST | LAST |
#                                  MIN | MAX | MEAN | BLEND}
    import arcpy
    arcpy.env.workspace = "c:/workspace"
    ##Create Mosaic Layer with selection and Lock Raster mosaic method
    arcpy.MakeMosaicLayer_management("fgdb.gdb/mdsrc", "mdlayer", "OBJECTID<10",\
                                     "", "", "LOCK_RASTER", "", "", "5",\
                                     "ASCENDING", "FIRST")
    ##Create Mosaic Layer with band extraction and clip template
    arcpy.MakeMosaicLayer_management("fgdb.gdb/mdsrc", "mdlayer2", "", \
                                     "clipmd.shp", "3;2;1", "BY_ATTRIBUTE",\
                                     "Tag", "Dataset", "", "DESCENDING", "LAST")
    print "Make Mosaic Layer exsample failed."
    print arcpy.GetMessages()


This tool does not use any geoprocessing environments

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes