# pyresample.utils.rasterio module

Utilities for working with rasterio objects.

pyresample.utils.rasterio.get_area_def_from_raster(source, area_id=None, name=None, proj_id=None, projection=None)

  Construct AreaDefinition object from raster.

  Parameters:

    - source (str, Dataset, DatasetReader or DatasetWriter) – A file name. Also it can be `osgeo.gdal.Dataset`, `rasterio.io.DatasetReader` or `rasterio.io.DatasetWriter`

    - area_id (str, optional) – ID of area

    - name (str, optional) – Description of area

    - proj_id (str, optional) – ID of projection

    - projection (pyproj.CRS, dict, or string, optional) – Projection parameters as a CRS object or a dictionary or string of PROJ.4 parameters.

  Returns:

    area_def – AreaDefinition object

  Return type:

    object