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 name | Description | Notes |
|---|---|---|
| Input raster file | The raster to split. | Can be single-band or multiband data. |
| Input vector file | The vector polygon data used for splitting. | Contains the split geometry, preferably polygon or multipolygon features. |
| Invert split area | When 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 cells | If enabled, cells that intersect polygon boundaries are also included in the split area (all_touched). | |
| Output first-part raster file | Output path for the first raster. | Naming: input_filesplit_raster_by_geometrytask_id.tif |
| Output second-part raster file | Output path for the second raster. | Naming: input_filesplit_raster_by_geometrytask_id(1).tif |
| Output file | Specifies the storage location, file name, data format, data type, and NoData value for the output raster data. | See common raster output. |
Steps
- In the Raster tools toolbox, go to Raster data > Raster processing, then open Split Raster by Polygon.
- Set Input raster file and Input vector file.
- Optional: enable Invert split area and Include boundary cells.
- 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.