Skip to main content

Split Raster by Polygon

Purpose

Use vector polygon geometry to split one raster into two output rasters:

  • First part: the raster inside the polygon area, or outside it depending on the invert parameter.
  • Second part: the complementary raster to the first part.

This is commonly used to save data inside and outside a study area separately, generate two inside/outside mask results, or split an input raster into retained and excluded areas by boundary.

Parameters

Parameter nameDescriptionNotes
Input raster fileThe raster to split.Can be single-band or multiband data.
Input vector fileThe vector polygon data used for splitting.Contains the split geometry, preferably polygon or multipolygon features.
Invert split areaWhen disabled by default, the first part is inside the polygons and the second part is outside. When enabled, the order is reversed.This does not change the split result. It only affects file naming.
Include boundary cellsIf enabled, cells that intersect polygon boundaries are also included in the split area (all_touched).
Output first-part raster fileOutput path for the first raster.Naming: input_filesplit_raster_by_geometrytask_id.tif
Output second-part raster fileOutput path for the second raster.Naming: input_filesplit_raster_by_geometrytask_id(1).tif
Output fileSpecifies the storage location, file name, data format, data type, and NoData value for the output raster data.See common raster output.

Steps

  1. In the Raster tools toolbox, go to Raster data > Raster processing, then open Split Raster by Polygon.
  2. Set Input raster file and Input vector file.
  3. Optional: enable Invert split area and Include boundary cells.
  4. Set the two output paths separately, then run the tool.

Split Illustration

Original data: black represents the original raster, and red represents the polygon feature used for splitting.

After splitting: red represents split raster 2, and blue represents split raster 1.

Notes

  • The two outputs are complementary. The same location will not retain valid values in both outputs. When one output has a valid value, the corresponding location in the other output is NoData.
  • This tool does not change the raster resolution or coordinate system. It only performs geometry-based mask splitting.