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

Mosaic To New Raster (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

Allows you to mosaic multiple raster datasets into a single raster dataset.


Usage tips

Command line syntax
An overview of the Command Line window
MosaicToNewRaster_management <Input_Rasters;Input_Rasters...> <Output_Location> <Raster_dataset_name_with_extension> {Coordinate_system_for_the_raster} {8_BIT_UNSIGNED | 1_BIT | 2_BIT | 4_BIT | 8_BIT_SIGNED | 16_BIT_UNSIGNED | 16_BIT_SIGNED | 32_BIT_UNSIGNED | 32_BIT_SIGNED | 32_BIT_FLOAT | 64_BIT} {Cellsize} {Number_of_bands} {FIRST | LAST | BLEND | MEAN | MINIMUM | MAXIMUM} {REJECT | FIRST | LAST | MATCH}

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

The input raster datasets.

Raster Layer
<Output_Location>

The path to contain the raster dataset. The path can be to a folder or geodatabase.

Workspace | Raster Catalog
<Raster_dataset_name_with_extension>

The name and extension of the raster dataset to be created.

When storing a raster dataset in a geodatabase (personal geodatabase, file geodatabase, or ArcSDE geodatabase), no file extension should be added to the name of the raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID.

When storing your raster dataset to a JPEG file, a JPEG 2000 file, or a geodatabase you can specify a compression type.

String
{Coordinate_system_for_the_raster}

Specifies the map projection of the output raster mosaic.

When entering values in the Command Line window, press F8 to enter this value.

Coordinate System
{8_BIT_UNSIGNED | 1_BIT | 2_BIT | 4_BIT | 8_BIT_SIGNED | 16_BIT_UNSIGNED | 16_BIT_SIGNED | 32_BIT_UNSIGNED | 32_BIT_SIGNED | 32_BIT_FLOAT | 64_BIT}

Specifies the bit depth of the output raster dataset.

You must set the pixel type to match your existing input raster datasets. If you do not set the pixel type the default, of 8-bit, will be used and your output might turn out incorrect.

  • 1_BIT — A 1-bit unsigned integer. The values can be 0 or 1.
  • 2_BIT — A 2-bit unsigned integer. The values supported can be from 0 to 3.
  • 4_BIT — A 4-bit unsigned integer. The values supported can be from 0 to 15.
  • 8_BIT_UNSIGNED — An 8-bit, unsigned data type. The values can range from 0 to 255. This is the default.
  • 8_BIT_SIGNED — An 8-bit signed data type. The values can range from -128 to 127.
  • 16_BIT_UNSIGNED — A 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16_BIT_SIGNED — A 16-bit signed data type. The values can range from -32,768 to 32,767.
  • 32_BIT_UNSIGNED — A 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32_BIT_SIGNED — A 32-bit signed data type supported by GRID. The values can range from -2,147,483,648 to 2,147,483,647.
  • 32_BIT_FLOAT — A 32-bit data type supporting decimals.
  • 64_BIT — A 64-bit data type supporting decimals.

String
{Cellsize}

The cell size for the new raster dataset.

Double
{Number_of_bands}

The number of bands to be contained by the raster dataset.

Long
{FIRST | LAST | BLEND | MEAN | MINIMUM | MAXIMUM}

The method used to mosaic overlapping areas.

  • FIRST — The output cell value of the overlapping areas will be the value from the first raster in the list.
  • LAST — The output cell value of the overlapping areas will be the value from the last raster in the list. This is the default.
  • 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}

Applies when the input raster datasets have a colormap. You can choose which colormap to apply to the final mosaic.

  • REJECT — Only the raster datasets that do not have a colormap associated with them will be mosaicked.
  • FIRST — Will use the colormap of the first input raster dataset. This is the default.
  • LAST — Will use the colormap of the last input raster dataset.
  • MATCH — Will take all the colormaps into consideration when mosaicking. If all possible values are already used (for the bit depth), it will attempt to match the value with the closest color that is available.

String
Data types for geoprocessing tool parameters


Command line example

MosaicToNewRaster_management C:/testdata/seattle1.tif;C:/testdata/seattle2.tif C:/rasters seattle.img 3 8_BITS_UNSIGNED # 1 BLEND #

Scripting syntax
About getting started with writing geoprocessing scripts
MosaicToNewRaster_management (Input_Rasters, Output_Location, Raster_dataset_name_with_extension, Coordinate_system_for_the_raster, Pixel_type, Cellsize, Number_of_bands, Mosaic_Method, Mosaic_Colormap_Mode)

Parameter Explanation Data Type
Input_Rasters (Required)

The input raster datasets.

Raster Layer
Output_Location (Required)

The path to contain the raster dataset. The path can be to a folder or geodatabase.

Workspace | Raster Catalog
Raster_dataset_name_with_extension (Required)

The name and extension of the raster dataset to be created.

When storing a raster dataset in a geodatabase (personal geodatabase, file geodatabase, or ArcSDE geodatabase), no file extension should be added to the name of the raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID.

When storing your raster dataset to a JPEG file, a JPEG 2000 file, or a geodatabase you can specify a compression type.

String
Coordinate_system_for_the_raster (Optional)

Specifies the map projection of the output raster mosaic.

When entering values in the Command Line window, press F8 to enter this value.

Coordinate System
Pixel_type (Optional)

Specifies the bit depth of the output raster dataset.

You must set the pixel type to match your existing input raster datasets. If you do not set the pixel type the default, of 8-bit, will be used and your output might turn out incorrect.

  • 1_BIT — A 1-bit unsigned integer. The values can be 0 or 1.
  • 2_BIT — A 2-bit unsigned integer. The values supported can be from 0 to 3.
  • 4_BIT — A 4-bit unsigned integer. The values supported can be from 0 to 15.
  • 8_BIT_UNSIGNED — An 8-bit, unsigned data type. The values can range from 0 to 255. This is the default.
  • 8_BIT_SIGNED — An 8-bit signed data type. The values can range from -128 to 127.
  • 16_BIT_UNSIGNED — A 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16_BIT_SIGNED — A 16-bit signed data type. The values can range from -32,768 to 32,767.
  • 32_BIT_UNSIGNED — A 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32_BIT_SIGNED — A 32-bit signed data type supported by GRID. The values can range from -2,147,483,648 to 2,147,483,647.
  • 32_BIT_FLOAT — A 32-bit data type supporting decimals.
  • 64_BIT — A 64-bit data type supporting decimals.

String
Cellsize (Optional)

The cell size for the new raster dataset.

Double
Number_of_bands (Optional)

The number of bands to be contained by the raster dataset.

Long
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 in the list.
  • LAST — The output cell value of the overlapping areas will be the value from the last raster in the list. This is the default.
  • 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)

Applies when the input raster datasets have a colormap. You can choose which colormap to apply to the final mosaic.

  • REJECT — Only the raster datasets that do not have a colormap associated with them will be mosaicked.
  • FIRST — Will use the colormap of the first input raster dataset. This is the default.
  • LAST — Will use the colormap of the last input raster dataset.
  • MATCH — Will take all the colormaps into consideration when mosaicking. If all possible values are already used (for the bit depth), it will attempt to match the value with the closest color that is available.

String

Data types for geoprocessing tool parameters


Script example

# MosaicToNew.py
# Description: mosaic multiple rasters to a new raster dataset
# Requirements: None
# Author: ESRI
# Date: 1/28/04
# Create the Geoprocessor object
import arcgisscripting
gp = arcgisscripting.create()

try:
    # Set local variables
    InRaster = "C:/testdata/seattle1.tif;C:/testdata/seattle2.tif"
    OutWorkspace = "C:/temp"

    # Process: MosaicToNew
    gp.MosaicToNewRaster_management(InRaster, OutWorkspace, "seattle7.img", "#", "8_BITS_UNSIGNED", "3","1", "#", "#")

except:
    # Print error message if an error occurs
    gp.GetMessages()

Model

Element Explanation
Create Raster Dataset

Creates a raster dataset in a geodatabase. When you create a raster dataset in a geodatabase, you are creating an empty location to contain a single raster dataset. You can then mosaic or load one or more raster datasets into the empty one.

Mosaic

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 containing data.


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