Skip to content

Instantly share code, notes, and snippets.

@mrpgraae
mrpgraae / split_bands.py
Last active January 18, 2019 09:56
Split multi-band raster into 1 file per band
import rasterio
IN_RASTER = 'raster_file.tif'
OUT_RASTER = 'raster_file_band{}.tif'
with rasterio.open(IN_RASTER) as src:
profile = src.profile.copy()
img = src.read()