Mosaic To New Raster (Data Management) |
|
Release 9.3
Last modified March 8, 2012 |
![]() ![]() ![]() Print all topics in : "Tools" |
NOTE: This topic was updated for 9.3.1.
Mosaics multiple raster datasets into a new 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.
When working with a large number of raster datasets, the Raster Catalog to Raster Dataset tool performs a mosaic more efficiently than Mosaic to New Raster Dataset.
The Mosaic tool has more parameters available when combining datasets into an existing raster, such as ignore background and NoData values.
You must set the pixel type to match your existing input raster datasets. If you do not set the pixel type, the 8-bit default will be used and your output might turn out incorrectly.
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 color maps, it is important to note differences across the color maps for each raster you choose to mosaic. You can still use the Mosaic tool if the raster datasets have different color maps; however, you must choose the proper color map mode. If an improper color map 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.
This 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 the 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), and 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, file, or ArcSDE), 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 8-bit default will be used and your output might turn out incorrectly.
|
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 color map. You can choose which color map to apply to the final mosaic.
|
String |
MosaicToNewRaster_management C:/testdata/seattle1.tif;C:/testdata/seattle2.tif C:/rasters seattle.img # 8_BITS_UNSIGNED 3 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, file, or ArcSDE), 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 8-bit default will be used and your output might turn out incorrectly.
|
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 color map. You can choose which color map 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", "BLEND", "#") 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. |