Summary
Creates an empty raster dataset.
Usage
When you create a raster dataset, you are creating an empty location to contain a single raster dataset. You can then mosaic or load raster datasets into this location.
You can save your output to BIL, BIP, BMP, BSQ, DAT, Esri Grid , GIF, IMG, JPEG, JPEG 2000, PNG, TIFF, MRF, CRF, or any geodatabase raster dataset.
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 in the Environments.
The GIF format only supports single-band raster datasets.
Building pyramids improves the display performance of raster datasets.
Calculating statistics allows ArcGIS applications to properly stretch and symbolize raster data for display.
Syntax
CreateRasterDataset(out_path, out_name, {cellsize}, pixel_type, {raster_spatial_reference}, number_of_bands, {config_keyword}, {pyramids}, {tile_size}, {compression}, {pyramid_origin})
Parameter | Explanation | Data Type |
out_path | The output location to store the raster dataset. | Workspace; Raster Catalog |
out_name | The name, location and format for the dataset you are creating. When storing the raster dataset in a file format, you need to specify the file extension:
When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset. When storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a Compression Type and Compression Quality in the geoprocessing Environments. | String |
cellsize (Optional) | The cell size for the new raster dataset. | Double |
pixel_type | The bit-depth (radiometric resolution) of the output raster dataset. If this is not specified, your raster dataset will be created with a default pixel type of 8-bit unsigned integer. Not all data types are supported by all raster formats. Check the Supported raster dataset file formats help topic to be sure the format you are using will support the data type you need.
| String |
raster_spatial_reference (Optional) | The coordinate system for the output raster dataset. If this is not specified, the coordinate system set in the environment settings will be used. | Coordinate System |
number_of_bands | The number of bands that the output raster dataset will have. | Long |
config_keyword (Optional) | Specifies the storage parameters (configuration) for a file or enterprise geodatabase. Configuration keywords are set up by your database administrator. | String |
pyramids (Optional) | Creates pyramids. For Pyramid Levels, specify a number of -1 or higher. A value of 0 will not build any pyramids, and a value of -1 will automatically determine the correct number of pyramid layers to create. The Pyramid Resampling Technique defines how the data will be resampled when building the pyramids.
The Pyramid Compression Type defines the method used when compressing the pyramids.
| Pyramid |
tile_size (Optional) | Specifies the size of the tiles. The tile width controls the number of pixels you can store in each tile. This is specified as a number of pixels in x. The default tile width is 128. The tile height controls the number of pixels you can store in each tile. This is specified as a number of pixels in y. The default tile height is 128. Only geodatabases and enterprise geodatabases use tile size. | Tile Size |
compression (Optional) | Defines the type of compression to store the raster dataset.
| Compression |
pyramid_origin (Optional) | The origination location of the raster pyramid. It is recommended that you specify this point if you plan on building large mosaics in a file geodatabase or enterprise geodatabase, especially if you plan on mosaicking to them over time (for example, for updating). The pyramid reference point should be set to the upper left corner of your raster dataset. In setting this point for a file geodatabase or enterprise geodatabase, partial pyramiding will be used when updating with a new mosaicked raster dataset. Partial pyramiding updated the parts of the pyramid that do not exist due to the new mosaicked datasets. Therefore, it is good practice to set your pyramid reference point so that your entire raster mosaic will be below and to the right of this point. However, a pyramid reference point should not be set too large either. | Point |
Derived Output
Name | Explanation | Data Type |
out_raster_dataset | The output raster dataset. | Raster Dataset |
Code sample
CreateRasterDataset example 1 (Python window)
This is a Python sample for the CreateRasterDataset tool.
import arcpy
arcpy.CreateRasterDataset_management("c:/data", "EmptyTIFF.tif", "2",
"8_BIT_UNSIGNED", "World_Mercator.prj",
"3", "", "PYRAMIDS -1 NEAREST JPEG",
"128 128", "NONE", "")
CreateRasterDataset example 2 (stand-alone script)
This is a Python script sample for the CreateRasterDataset tool.
##==================================
##Create Raster Dataset
##Usage: CreateRasterDataset_management out_path out_name {cellsize} 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 {raster_spatial_reference} number_of_bands {config_keyword} {pyramids} {tile_size}
## {compression} {pyramid_origin}
import arcpy
arcpy.env.workspace = r"\\workspace\PrjWorkspace\RasGP"
##Create a empty TIFF format Raster Dataset with the following parameters
##Cellsize: 2
##Pixel type: 8 Bit Unsigned Integer
##Number of Bands: 3
##Pyramid: Build full pyramids with NEAREST interpolation and JPEG compression
##Compression: NONE
##Projection: World_Mercator
##Tile size: 128 128
arcpy.CreateRasterDataset_management("CreateRD","EmptyTIFF.tif","2","8_BIT_UNSIGNED",\
"World_Mercator.prj", "3", "", "PYRAMIDS -1 NEAREST JPEG",\
"128 128", "NONE", "")
##Create a SDE Raster Dataset
##No Spatial Reference, with Pyramid Origin
arcpy.CreateRasterDataset_management("CreateRD\\CreateRD.gdb","NewRD","10","16_BIT_UNSIGNED",\
"", "1", "MAX_FILE_SIZE_4GB", "PYRAMIDS 3 BILINEAR DEFAULT",\
"128 128", "JPEG2000 80", "-20037508.34278775 30198185.16987658")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes