Split Raster (Data Management)

License Level:BasicStandardAdvanced

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 file name. The tile number is then appended to complete the file name, which starts with 0.

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

String
split_method

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

The file format for the output raster datasets.

  • TIFFTagged Image File Format. This is the default.
  • BMPMicrosoft Bitmap.
  • 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 Photographic 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 parameter will determine the units that are used for these values.

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

The minimum tile size that can be specified it 64 rows by 64 columns.

Point
overlap
(Optional)

The number of pixels of overlap between the adjoining tiles. The overlap value will be determined by the units parameter.

Double
units
(Optional)

Determines the units that apply to the tile_size 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

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013