Split Raster (Data Management)

Summary

Divides a raster dataset into smaller pieces, by tiles or features from a polygon.

Usage

  • The output files will share most of the properties of the input source raster, such as the spatial reference, source type, pixel type, pixel depth, and cell size.

  • The tiling method determines which of the optional parameters are used to determine the dimensions and location of the output tiles. In both cases, NoData values are used to pad the tiles where there is no corresponding source data. The data format depends on the limitations of the individual format specifications and the source image data type. Invalid combinations result in an appropriate error message.

  • If a tile already exists (if there is a file with the same name), it will not be overwritten.

  • If a tile only contains NoData pixel values, it will not be created.

Syntax

arcpy.management.SplitRaster(in_raster, out_folder, out_base_name, split_method, format, {resampling_type}, {num_rasters}, {tile_size}, {overlap}, {units}, {cell_size}, {origin}, {split_polygon_feature_class}, {clip_type}, {template_extent}, {nodata_value})
ParameterExplanationData Type
in_raster

The raster to split.

Mosaic Dataset; Mosaic Layer; Raster Layer
out_folder

The destination for the new raster datasets.

Folder
out_base_name

The prefix for each of the raster datasets you will create. A number will be appended to each prefix, starting with 0.

String
split_method

Determines how to split the raster dataset.

  • SIZE_OF_TILESpecify the width and height of the tile.
  • NUMBER_OF_TILES Specify the number of raster tiles to create by breaking the dataset into a number of columns and rows.
  • POLYGON_FEATURES Use the individual polygon geometries in a feature class to split the raster.
String
format

The 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 an appropriate technique based on the type of data you have.

  • NEARESTThe fastest resampling method, and it minimizes changes to pixel values. Suitable for discrete data, such as land cover.
  • BILINEARCalculates the value of each pixel by averaging (weighted for distance) the values of the surrounding 4 pixels. Suitable for continuous data.
  • CUBICCalculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. Produces the smoothest image, but can create values outside of the range found in the source data. Suitable for continuous data.
String
num_rasters
(Optional)

The number of columns (x) and rows (y) to split the raster dataset into. This is a point whose X and Y coordinates define number of rows and columns. The X coordinate is the number of columns and the Y coordinate is the number of rows.

Point
tile_size
(Optional)

The x and y dimensions of the output tiles. The default unit of measurement is in pixels. You can change this with the units parameter. This is a point whose X and Y coordinates define the dimensions of output tiles. The X coordinate is the horizontal dimension of the output and the Y coordinate is the vertical dimension of the output.

Point
overlap
(Optional)

The tiles do not have to line up perfectly; set the amount of overlap between tiles with this parameter. The default unit of measurement is in pixels. You can change this with the units parameter.

Double
units
(Optional)

Set the units of measurement for 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)

The spatial resolution of the output raster. If left blank, the output cell size will match the input raster. When you change the cell size values, the tile size is reset to the image size and the tile count is reset to 1.

Point
origin
(Optional)

Change the coordinates for the lower left origin point, where the tiling scheme will begin. If left blank, the lower left origin would be the same as the input raster.

Point
split_polygon_feature_class
(Optional)

A feature class that will be used to split the raster dataset.

Feature Layer
clip_type
(Optional)

Limits the extent of your raster dataset before you split it.

  • NONE Use the full extent of the input raster dataset.
  • EXTENTSpecify bounding box as your clipping boundary.
  • FEATURE_CLASSSpecify a feature class to clip the extent.
String
template_extent
(Optional)

An extent or a dataset used to define the clipping boundary. The dataset can be a raster or feature class.

  • MAXOF—The maximum extent of all inputs will be used.
  • MINOF—The minimum area common to all inputs will be used.
  • DISPLAY—The extent is equal to the visible display.
  • Layer name—The extent of the specified layer will be used.
  • Extent object—The extent of the specified object will be used.
  • Space delimited string of coordinates—The extent of the specified string will be used. Coordinates are expressed in the order of x-min, y-min, x-max, y-max.
Extent
nodata_value
(Optional)

All the pixels with the specified value will be set to NoData in the output raster dataset.

String

Derived Output

NameExplanationData Type
derived_out_folder

The output folder.

Folder

Code sample

SplitRaster example 1 (Python window)

This is a Python sample for the SplitRaster tool.

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 the SplitRaster tool.

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

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics