geodata.mask.crop_raster
========================

.. py:function:: geodata.mask.crop_raster(raster: rasterio.DatasetReader, bounds: tuple[float, float, float, float], lat_lon_bounds: bool = True) -> rasterio.DatasetReader

   Crop a raster given geographical coordinates or its array index bounds

   :param raster: An opened rasterio tif dataset.
   :type raster: ras.DatasetReader
   :param bounds: Geographical coordinates or array index bounds.
   :type bounds: tuple[float, float, float, float]
   :param lat_lon_bounds: If True (by default), the bounds tuple are latitude-longitude coords input.
   :type lat_lon_bounds: bool

   :returns: The cropped raster.
   :rtype: ras.DatasetReader

