Create Raster Dataset (Data Management)

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 the output to BIL, BIP, BMP, BSQ, CRF, DAT, Esri Grid, GIF, IMG, JPEG, JPEG 2000, PNG, or TIFF format, or any geodatabase raster dataset.

  • When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, or a geodatabase, you can specify a Compression Type value and a Compression Quality value in the geoprocessing environments.

  • The GIF format only supports single-band raster datasets.

  • A raster dataset created in CRF format is expandable. The extent of an expandable CRF dataset is adjusted automatically by other tools that accept CRF as an input, such as the Mosaic, Copy Raster, Clip Rasters, and Resample tools.

  • An expandable CRF dataset supports multidimensional rasters. An expandable multidimensional raster dataset is created when you add a multidimensional data to an empty raster dataset using the Mosaic tool. You can also define the multidimensional information for an empty raster dataset using ArcPy, as shown in the following example:

    Example of how to define the multidimensional information for an empty raster dataset. The definition of the multidimensional raster dataset is based on an existing multidimensional raster, represented by template.crf in the sample below.

    import arcpy
    arcpy.CheckOutExtension("ImageAnalyst")
    r = arcpy.Raster(r"\\location_to_a_mdim_raster\template.crf", True)
    r2 = arcpy.Raster(r"C:\Temp\expandable_mdim.crf")
    r2.mdinfo = r.mdinfo
    r2.mdinfo

  • Building pyramids improves the display performance of raster datasets.

  • Calculating statistics allows ArcGIS applications to properly stretch and symbolize raster data for display.

Parameters

LabelExplanationData Type
Output Location

The folder or geodatabase where the raster dataset will be stored.

Workspace
Raster Dataset Name with Extension

The name, location, and format for the newly created dataset.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bil for Esri BIL
  • .bip for Esri BIP
  • .bmp for BMP
  • .bsq for Esri BSQ
  • .crf for CRF
  • .dat for ENVI DAT
  • .gif for GIF
  • .img for ERDAS IMAGINE
  • .jpg for JPEG
  • .jp2 for JPEG 2000
  • .png for PNG
  • .tif for TIFF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

String
Cellsize
(Optional)

The pixel size that will be used for the new raster dataset.

Double
Pixel Type

The bit depth (radiometric resolution) of the output raster dataset. If this is not specified, the 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 List of supported sensors help topic to ensure that the format you are using will support the necessary data type.

  • 1 bitThe pixel type will be a 1-bit unsigned integer. The values can be 0 or 1.
  • 2 bitThe pixel type will be a 2-bit unsigned integer. The values supported can range from 0 to 3.
  • 4 bitThe pixel type will be a 4-bit unsigned integer. The values supported can range from 0 to 15.
  • 8 bit unsignedThe pixel type will be an unsigned 8-bit data type. The values supported can range from 0 to 255.
  • 8 bit signedThe pixel type will be a signed 8-bit data type. The values supported can range from -128 to 127.
  • 16 bit unsignedThe pixel type will be a 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16 bit signedThe pixel type will be a 16-bit signed data type. The values can range from -32,768 to 32,767.
  • 32 bit unsignedThe pixel type will be a 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32 bit signedThe pixel type will be a 32-bit signed data type. The values can range from -2,147,483,648 to 2,147,483,647.
  • 32 bit floatThe pixel type will be a 32-bit data type supporting decimals.
  • 64 bitThe pixel type will be a 64-bit data type supporting decimals.
String
Spatial Reference for Raster
(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 of the output raster dataset.

Long
Configuration Keyword
(Optional)

The storage parameters (configuration) for a file or enterprise geodatabase. Configuration keywords are set up by your database administrator.

String
Create pyramids
(Optional)

Creates pyramids.

For Pyramid Levels, specify a number of -1 or higher. A value of 0 will not create pyramids, and a value of -1 will automatically determine the correct number of pyramid layers to create.

Pyramid Resampling Technique defines how the data will be resampled when creating the pyramids.

  • NEAREST—Use nearest neighbor for nominal data or raster datasets with color maps, such as land-use or pseudo color images.
  • BILINEAR—Use bilinear interpolation with continuous data, such as satellite imagery or aerial photography.
  • CUBIC—Use cubic convolution continuous data, such as satellite imagery or aerial photography. It is similar to bilinear interpolation; however, it resamples the data using a larger matrix.

Pyramid Compression Type defines the method used when compressing the pyramids.

  • DEFAULT—The compression that is normally used by the raster dataset format will be used.
  • LZ77—A lossless compression will be used. The values of the cells in the raster will not be changed.
  • JPEG—A lossy compression will be used.
  • NONE—No data compression will be used.
Pyramid
Tile size
(Optional)

The size of the tiles.

The tile width controls the number of pixels that can be stored 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 that can be stored 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)

Specifies the type of compression that will be used to store the raster dataset.

  • NoneNo compression will be used. This is the default.
  • LZ77Lossless compression that preserves all raster cell values will be used.
  • JpegLossy compression that uses the public JPEG compression algorithm will be used. If you choose JPEG, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100. This compression can be used for .jpg files and .tif files.
  • Jpeg 2000Lossy compression will be used.
  • LzwLossless compression that preserves all raster cell values will be used.
  • PackbitsPackBits compression will be used for .tif files.
  • RleRun-length encoding will be used for .img files.
  • Ccitt Group 3Lossless compression for 1-bit data will be used.
  • Ccitt Group 4Lossless compression for 1-bit data will be used.
  • Ccitt 1DLossless compression for 1-bit data will be used.
Compression
Origin/Pyramid Reference Point
(Optional)

The origination location of the raster pyramid. It is recommended that you specify this point if you plan to build large mosaics in a file geodatabase or enterprise geodatabase, especially if you plan to mosaic them over time (for example, when updating).

Set the pyramid reference point at the upper left corner of the 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 updates the parts of the pyramid that do not exist due to the new mosaicked datasets. It is a good practice to set a pyramid reference point so that the 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

LabelExplanationData Type
Output Raster Dataset

The output raster dataset.

Raster Dataset

arcpy.management.CreateRasterDataset(out_path, out_name, {cellsize}, pixel_type, {raster_spatial_reference}, number_of_bands, {config_keyword}, {pyramids}, {tile_size}, {compression}, {pyramid_origin})
NameExplanationData Type
out_path

The folder or geodatabase where the raster dataset will be stored.

Workspace
out_name

The name, location, and format for the newly created dataset.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bil for Esri BIL
  • .bip for Esri BIP
  • .bmp for BMP
  • .bsq for Esri BSQ
  • .crf for CRF
  • .dat for ENVI DAT
  • .gif for GIF
  • .img for ERDAS IMAGINE
  • .jpg for JPEG
  • .jp2 for JPEG 2000
  • .png for PNG
  • .tif for TIFF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

String
cellsize
(Optional)

The pixel size that will be used for the new raster dataset.

Double
pixel_type

The bit depth (radiometric resolution) of the output raster dataset. If this is not specified, the 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 List of supported sensors help topic to ensure that the format you are using will support the necessary data type.

  • 1_BITThe pixel type will be a 1-bit unsigned integer. The values can be 0 or 1.
  • 2_BITThe pixel type will be a 2-bit unsigned integer. The values supported can range from 0 to 3.
  • 4_BITThe pixel type will be a 4-bit unsigned integer. The values supported can range from 0 to 15.
  • 8_BIT_UNSIGNEDThe pixel type will be an unsigned 8-bit data type. The values supported can range from 0 to 255.
  • 8_BIT_SIGNEDThe pixel type will be a signed 8-bit data type. The values supported can range from -128 to 127.
  • 16_BIT_UNSIGNEDThe pixel type will be a 16-bit unsigned data type. The values can range from 0 to 65,535.
  • 16_BIT_SIGNEDThe pixel type will be a 16-bit signed data type. The values can range from -32,768 to 32,767.
  • 32_BIT_UNSIGNEDThe pixel type will be a 32-bit unsigned data type. The values can range from 0 to 4,294,967,295.
  • 32_BIT_SIGNEDThe pixel type will be a 32-bit signed data type. The values can range from -2,147,483,648 to 2,147,483,647.
  • 32_BIT_FLOATThe pixel type will be a 32-bit data type supporting decimals.
  • 64_BITThe pixel type will be a 64-bit data type supporting decimals.
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 of the output raster dataset.

Long
config_keyword
(Optional)

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 create pyramids, and a value of -1 will automatically determine the correct number of pyramid layers to create.

Pyramid Resampling Technique defines how the data will be resampled when creating the pyramids.

  • NEAREST—Use nearest neighbor for nominal data or raster datasets with color maps, such as land-use or pseudo color images.
  • BILINEAR—Use bilinear interpolation with continuous data, such as satellite imagery or aerial photography.
  • CUBIC—Use cubic convolution with continuous data, such as satellite imagery or aerial photography. It is similar to bilinear interpolation; however, it resamples the data using a larger matrix.

Pyramid Compression Type defines the method used when compressing the pyramids.

  • DEFAULT—The compression that is normally used by the raster dataset format will be used.
  • LZ77—A lossless compression will be used. The values of the cells in the raster will not be changed.
  • JPEG—A lossy compression will be used.
  • NONE—No data compression will be used.
Pyramid
tile_size
(Optional)

The size of the tiles.

The tile width controls the number of pixels that can be stored 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 that can be stored 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)

Specifies the type of compression that will be used to store the raster dataset.

  • LZ77Lossless compression that preserves all raster cell values will be used.
  • JPEGLossy compression that uses the public JPEG compression algorithm will be used. If you choose JPEG, you can also specify the compression quality. The valid compression quality value ranges are from 0 to 100. This compression can be used for .jpg files and .tif files.
  • JPEG 2000Lossy compression will be used.
  • PACKBITSPackBits compression will be used for .tif files.
  • LZWLossless compression that preserves all raster cell values will be used.
  • RLERun-length encoding will be used for .img files.
  • CCITT GROUP 3Lossless compression for 1-bit data will be used.
  • CCITT GROUP 4Lossless compression for 1-bit data will be used.
  • CCITT_1DLossless compression for 1-bit data will be used.
  • NONENo compression will be used. This is the default.
Compression
pyramid_origin
(Optional)

The origination location of the raster pyramid. It is recommended that you specify this point if you plan to build large mosaics in a file geodatabase or enterprise geodatabase, especially if you plan to mosaic them over time (for example, when updating).

Set the pyramid reference point at the upper left corner of the 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 updates the parts of the pyramid that do not exist due to the new mosaicked datasets. It is a good practice to set a pyramid reference point so that the 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

NameExplanationData 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 function.

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 function.

##==================================
##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")

Related topics