Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > Raster toolset > Tools

Mosaic (Data Management)

Release 9.2
Last modified November 29, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

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

Command line syntax
An overview of the Command Line window
Mosaic_management <inputs;inputs...> <target> {mosaic_type} {REJECT | FIRST | LAST | MATCH} {background_value} {nodata_value} {NONE | OneBitTo8Bit} {mosaicking_tolerance}

Parameter Explanation Data Type
<inputs;inputs...>

The input raster datasets.

Raster Layer
<target>

The target raster dataset.

This raster dataset must already exist.

Raster Dataset
{mosaic_type}

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
{REJECT | FIRST | LAST | MATCH}

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
{background_value}

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}

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

Double
{NONE | OneBitTo8Bit}

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}

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


Command line example

mosaic_management D:\images\raster1;D:\images\raster2;D:\images\raster3 D:\California.mdb\NewRasterDataset LAST MATCH 0 # NONE 0

Scripting syntax
About getting started with writing geoprocessing scripts
Mosaic_management (inputs, target, mosaic_type, colormap, background_value, nodata_value, onebit_to_eightbit, mosaicking_tolerance)

Parameter Explanation Data Type
inputs (Required)

The input raster datasets.

Raster Layer
target (Required)

The target raster dataset.

This raster dataset must already exist.

Raster Dataset
mosaic_type (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
colormap (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
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
onebit_to_eightbit (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.

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.