Mosaic (Data Management)

Mosaics multiple input rasters into a single raster dataset. The target raster must be an existing raster dataset, which can be an empty raster dataset or one already containing data.

Learn more about mosaicking raster datasets


Illustration

Mosaic illustration

Usage Tips

Syntax

Mosaic_management (inputs, target, mosaic_type, colormap, background_value, nodata_value, onebit_to_eightbit, mosaicking_tolerance)
Parameter Explanation Datatype
Input Rasters (Required)

The input raster datasets.

Raster Layer
Target Raster (Required)

The target raster dataset.

This raster dataset must already exist.

Raster Dataset
Mosaic Method (Optional)

The method used to mosaic overlapping areas.

  • FIRST—The output cell value of the overlapping areas will be the value from the first raster dataset in the list.
  • LAST—The output cell value of the overlapping areas will be the value from the last raster dataset in the list. This is the default (and is also the fastest mosaic type).
  • BLEND—The output cell value of the overlapping areas will be a blend of values that overlap; this blend value is based on an algorithm that is weight based and is dependent on the distance from the pixel to the edge within the overlapping area.
  • MEAN—The output cell value of the overlapping areas will be the mean value of the overlapped cells.
  • MINIMUM—The output cell value of the overlapping areas will be the minimum value of the overlapped cells.
  • MAXIMUM—The output cell value of the overlapping areas will be the maximum value of the overlapped cells.

String
Mosaic Colormap Mode (Optional)

The method used to choose which colormap from the input rasters will be applied to the mosaic output.

  • REJECT—Only the raster datasets that do not have a colormap associated with them will be mosaicked.
  • FIRST—The colormap from the first raster dataset in the list will be applied to the output raster dataset. This is the default.
  • LAST—The colormap from the last raster dataset in the list will be applied to the output raster dataset.
  • MATCH—Makes sure that the colors in the final colormap are all unique.

String
Ignore Background Value (Optional)

Specifies the pixel value in the raster dataset that would be recognized as a background value, and not a valuable part of the data. The pixel value specified will be set to NoData in the output raster dataset. Use this option after rotating or projecting an image to remove the unwanted values created around the original raster data. Even if this value is not unique in the dataset, it will be distinguished from other valuable data in the raster dataset. For example, a value of zero along the raster dataset's borders will be distinguished from zero values within the raster dataset.

Double
Nodata Value (Optional)

All the pixels with the specified value will be set to NoData in the output raster dataset.

Double
Convert 1 bit data to 8 bit (Optional)

Choose whether the input 1-bit raster dataset will be converted to an 8-bit raster dataset. In this conversion the value 1 in the input raster dataset will be changed to 255 in the output raster dataset. This is useful when importing a 1-bit raster dataset to ArcSDE. 1-bit raster datasets have 8-bit pyramid layers when stored in a file system, but in ArcSDE, 1-bit raster datasets can only have 1-bit pyramid layers, which makes the display unpleasant. By converting the data to 8-bit in ArcSDE, the pyramid layers are built as 8-bit instead of 1-bit, resulting in a properly appearing raster dataset in the display.

  • NONE—No conversion will be done. This is the default.
  • OneBitTo8Bit—The input raster will be converted.

Boolean
Mosaicking Tolerance (Optional)

When mosaicking takes place, the target and the source pixels do not always line up exactly. When there is a misalignment of pixels, a decision needs to be made whether resampling takes place or whether the data should be shifted. The mosaicking tolerance controls whether resampling of the pixels take place or if the pixels should be shifted.

If the difference in pixel alignment (of the incoming dataset and the target dataset) is greater than the tolerance, resampling will take place.

If the difference in pixel alignment (of the incoming dataset and the target dataset) is less than the tolerance, resampling will not take place (instead, a shift is performed).

The unit of tolerance is a pixel; the valid value range is 0 to 0.9999. The maximum a pixel can be shifted is 0.5, so anything you set that is greater than 0.5 will guaranty a shift takes place. A tolerance of zero guaranty resampling if there is a misalignment in pixels.

For example, the source and target pixels have a misalignment of 0.25. If the mosaicking tolerance is set to 0.2, then resampling will take place since the pixel misalignment is greater than the tolerance. If the mosaicking tolerance is set to 0.3, then the pixels will be shifted.

Double
Data types for geoprocessing tool parameters

Script Example

# Mosaic_sample.py
# Description: Mosaic rasters to an existing raster dataset 
# Requirements: None
# Author: ESRI
# Date: 1/28/04

import arcgisscripting
gp = arcgisscripting.create()

gp.workspace = "c:/redlands_data"
gp.Mosaic_management("redlands1.tif; redlands2.tif" , "Database Connections\Connection to raster.sde\raster.redlands","LAST","MATCH", "0", "#", "NONE", "0")

Map Algebra syntax

See Merge or Mosaic


ArcObjects syntax

There is no corresponding ArcGIS Spatial Analyst object to perform Merge or Mosaic. However, in core ArcGIS, similar functionality can be found in the IRasterGeometryProc object. For more information, see ArcObjects Developer Help.


See Also

  • Build Pyramids (Data Management)
  • Mosaic to New Raster (Data Management)
  • Create Raster Dataset (Data Management)
  • Mosaicking raster datasets