Split Raster (Data Management)

Summary

Creates a tiled output from an input raster dataset.

Usage

Syntax

SplitRaster_management (in_raster, out_folder, out_base_name, {split_method}, {format}, {resampling_type}, {num_rasters}, {tile_size}, {overlap}, {Units}, {Cell_size}, {origin})
ParameterExplanationData Type
in_raster

The input raster dataset to be split into tiles.

Raster Layer
out_folder

The output folder, where the tiles will be created.

Folder
out_base_name

The prefix for each filename. The tile number is then appended to complete the filename, which starts with 0.

By default, the prefix is the same name as the input raster.

String
split_method
(Optional)

The tiling method to be used when splitting the raster dataset. It will determine the size and number of tiles for each output dataset.

  • SIZE_OF_TILEAllows you to specify the tile width and tile height. Then the appropriate number of tiles will be created. This is the default method. You can also specify a different lower left origin, different output pixel sizes, and the amount of overlap between adjoining tiles (in pixels, meters, feet, degrees, miles, or kilometers).
  • NUMBER_OF_TILES Allows you to specify the number of raster tiles to create in the horizontal and the vertical direction. Then the appropriate tile size will be created for each dataset. You can also specify a different lower left origin, different output pixel sizes, and the amount of overlap between adjoining tiles (in pixels, meters, feet, degrees, miles, or kilometers).
String
format
(Optional)

The file format for the output raster datasets.

  • TIFFTagged Image File Format. This is the default.
  • BMPBitmap.
  • ENVIENVI DAT.
  • ESRI BILESRI band interleaved by line.
  • ESRI BIPESRI band interleaved by pixel.
  • ESRI BSQESRI band sequential.
  • GIFGraphic interchange format.
  • GRIDESRI GRID.
  • IMAGINE IMAGEERDAS IMAGINE.
  • JP2JPEG 2000.
  • JPEGJoint Photographics Experts Group.
  • PNGPortable Network Graphics.
String
resampling_type
(Optional)

Choose the resampling method to use when splitting your raster. The default is bilinear interpolation resampling.

  • NEARESTNearest neighbor assignment
  • BILINEARBilinear interpolation
  • CUBICCubic convolution
  • MAJORITYMajority resampling
String
num_rasters
(Optional)

Specify the number of tiles in each direction. The default value is 1 tile for each direction.

This option is only valid when the tiling method is NUMBER_OF_TILES.

Point
tile_size
(Optional)

The x and y dimensions of the output tiles. The "Units for Output Raster Size and Overlap" parameter will determine the units that are used for these values.

This option is only valid when the tiling method is SIZE_OF_TILE.

Point
overlap
(Optional)

The number of pixels of overlap between the adjoining tiles. The overlap value will be determined by the "Units for Output Raster Size and Overlap" parameter.

Double
Units
(Optional)

Determines the units that apply to the "Size of Output Rasters" and the "Overlap" parameters.

  • PIXELSThe unit is in pixels. This is the default.
  • METERSThe unit is in meters.
  • FEETThe unit is in feet.
  • DEGREESThe unit is in decimal degrees.
  • MILESThe unit is in miles.
  • KILOMETERSThe unit is in kilometers.
String
Cell_size
(Optional)

Specify the output pixel size in each direction. By default, the output will match the input raster. If the cell size values are changed, the tile size and count are reset to their default values (image size and 1, respectively).

This parameter is based on the output spatial reference system, which is set in the Environment Settings.

Point
origin
(Optional)

The coordinate for the lower left origin point, where the tiling scheme will begin. By default, the lower left origin would be the same as the input raster.

This parameter is based on the output spatial reference system, which is set in the Environment Settings.

Point

Code Sample

SplitRaster example 1 (Python window)

This is a Python sample for SplitRaster.

import arcpy
arcpy.SplitRaster_management("c:/source/large.tif", "c:/output/splitras",
                             "ras", "NUMBER_OF_TILES", "TIFF", "NEAREST",
                             "2 2", "#", "10", "PIXELS", "#", "#")
SplitRaster example 2 (stand-alone script)

This is a Python script sample for SplitRaster.

##====================================
##Split Raster
##Usage: SplitRaster_management in_raster out_folder out_base_name SIZE_OF_TILE
##                              | NUMBER_OF_TILES | TIFF | BMP | ENVI | ESRI BIL |
##                              ESRI BIP | ESRI BSQ | GIF | GRID | IMAGINE IMAGE | 
##                              JP2 | JPG | PNG {NEAREST | BILINEAR | CUBIC | 
##                              MAJORITY} {num_rasters} {tile_size} {overlap} 
##                              {PIXELS | METERS | FEET | DEGREES | KILOMETERS | 
##                              MILES} {cell_size} {origin}
    
try:
    import arcpy
    arcpy.env.workspace = r"\\myServer\PrjWorkspace\RasGP"
    
    ##Equally split a large TIFF image by number of images
    arcpy.SplitRaster_management("large.tif", "splitras", "number", "NUMBER_OF_TILES",\
                                 "TIFF", "NEAREST", "2 2", "#", "4", "PIXELS",\
                                 "#", "#")
    
    ##Equally split a large TIFF image by size of images
    arcpy.SplitRaster_management("large.tif", "splitras", "size2", "SIZE_OF_TILE",\
                                 "TIFF", "BILINEAR", "#", "3500 3500", "4", "PIXELS",\
                                 "#", "-50 60")

except:
    print "Split Raster exsample failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

10/27/2014