Create Mosaic Dataset (Data Management)

Summary

Makes an empty mosaic dataset in a geodatabase.

Usage

Syntax

CreateMosaicDataset_management (in_workspace, in_mosaicdataset_name, coordinate_system, {num_bands}, {pixel_type})
ParameterExplanationData Type
in_workspace

The path and name of a geodatabase.

Workspace
in_mosaicdataset_name

The name of the mosaic dataset.

String
coordinate_system

The coordinate system for the mosaic dataset, which will be used for all the associated files or features created.

Spatial Reference
num_bands
(Optional)

The number of raster dataset bands supported by the mosaic dataset.

Long
pixel_type
(Optional)

The bit depth of a cell, used to determine the range of values that the mosaic dataset output. For example, an 8-bit mosaic dataset can have 256 unique pixel values, which range from 0 to 255.

If it is not defined, it will be taken from the first raster dataset.

  • 1_BITA 1-bit unsigned integer. The values can be 0 or 1.
  • 2_BITA 2-bit unsigned integer. The values supported can be from 0 to 3.
  • 4_BITA 4-bit unsigned integer. The values supported can be from 0 to 15.
  • 8_BIT_UNSIGNEDAn unsigned 8-bit data type. The values supported can be from 0 to 255.
  • 8_BIT_SIGNEDA signed 8-bit data type. The values supported can be from -128 to 127.
  • 16_BIT_UNSIGNEDA 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16_BIT_SIGNEDA 16-bit signed data type. The values can range from -32,768 to 32,767.
  • 32_BIT_UNSIGNEDA 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32_BIT_SIGNEDA 32-bit signed data type. The values can range from -2,147,483,648 to 2,147,483,647.
  • 32_BIT_FLOATA 32-bit data type supporting decimals.
  • 64_BITA 64-bit data type supporting decimals.
String

Code Sample

CreateMosaicDataset example 1 (Python window)

This is a Python sample for CreateMosaicDataset.

import arcpy
arcpy.CreateMosaicDataset_management("c:/workspace/CreateMD.gdb",\
                                     "MyMosDS", "World_Mercator.prj",\
                                     "3", "8_BIT_UNSIGNED")
CreateMosaicDataset example 2 (stand-alone script)

This is a Python script sample for CreateMosaicDataset.

##===========================
##Create Mosaic Dataset
##Usage: CreateMosaicDataset_management in_workspace in_mosaicdataset_name coordinate_system {num_bands} 
##                                      {1_BIT | 2_BIT | 4_BIT | 8_BIT_UNSIGNED | 8_BIT_SIGNED | 16_BIT_UNSIGNED | 16_BIT_SIGNED | 
##                                      32_BIT_UNSIGNED | 32_BIT_SIGNED | 32_BIT_FLOAT | 64_BIT}
try:
    import arcpy
    arcpy.env.workspace = r"C:\Workspace"
    ##Create 3-Band FGDB Mosaic Dataset
    arcpy.CreateMosaicDataset_management("CreateMD.gdb","mosaicds", "World_Mercator.prj", "3", "8_BIT_UNSIGNED")
    ##Create 1-Band PGDB Mosaic Dataset
    arcpy.CreateMosaicDataset_management("CreateMD.mdb","mosaicds", "GCS_WGS_1984.prj", "1", "")
    ##Create SDE Mosaic Dataset
    arcpy.CreateMosaicDataset_management("SDE94.sde","mosaicds", "GCS_WGS_1984.prj", "6", "16_BIT_UNSIGNED")
except:
    print "Create Mosaic Dataset exsample failed."
    print arcpy.GetMessages()

Environments

Output Coordinate System

Will only be used if the Coordinate System parameter is not defined

Related Topics

Licensing Information

ArcView: No
ArcEditor: Yes
ArcInfo: Yes

10/27/2014