ClipΒΆ

from girs.rast.raster import RasterReader
from girs.feat.layers import LayersReader
lrs = LayersReader('D:/tmp/riverbasins.shp')
r = RasterReader('D:/tmp/chirps_original/chirps-v2.0.2016.01.10.tif')
r.clip_by_vector(layers_in=lrs, output_raster='D:/tmp/clip_by_vector1.tif')
r.clip_by_vector(layers_in=lrs, output_raster='D:/tmp/clip_by_vector2.tif', all_touched=True)
../_images/clip_by_vector.jpg