Mosaic To New Raster (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Allows you to mosaic multiple raster datasets into a single raster dataset.
Usage tips
The input raster datasets are all the raster datasets you would like to mosaic together. The inputs must have the same number of bands and same bit depth; otherwise, the Mosaic tool used in the model will not run.
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.
You can save your output to BMP, GIF, GRID, IMG, JPEG, JPEG 2000, PNG, TIFF, or any geodatabase raster dataset.
When storing a raster dataset in a 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 and compression quality within the Raster Storage Settings in the Environment Settings dialog box.
The GIF format only supports single-band raster datasets.
When mosaicking with raster datasets containing colormaps, it is important to note differences across the colormaps for each raster you choose to mosaic. You can still use the Mosaic tool if the raster datasets have different colormaps; however, you must choose the proper colormap mode. If an improper colormap mode is chosen, your output might not turn out as you expected.
When you are entering commands and variables in the Command Line window and you come to a variable you do not know how to enter, press F8. You may need to do this when entering the coordinate system variable.
The Mosaic tool doesn't use the Output Extent, because the tool tends to create very large raster datasets, and the Output Extent setting might accidentally clip your data. If output extent does need to be adjusted, the Clip tool can achieve that operation.
The following environments affect this tool: current workspace, scratch workspace, output coordinate system, output extent (not with ArcSDE), output CONFIG keyword.
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.
|
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.
|
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.
|
String |
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.
|
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.
|
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.
|
String |
# 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. |