code: def get_geotiff_area_def(filename, crs):
      
      from osgeo import gdal
      from pyresample.geometry import AreaDefinition
      from pyresample.utils import proj4_str_to_dict
      fid = gdal.Open(filename)
      geo_transform = fid.GetGeoTransform()
      pcs_id = fid.GetProjection().split('"')[1]
      min_x = geo_transform[0]
      max_y = geo_transform[3]
      x_size = fid.RasterXSize
      y_size = fid.RasterYSize
      max_x = min_x + geo_transform[1] * x_size
      min_y = max_y + geo_transform[5] * y_size
      area_extent = [min_x, min_y, max_x, max_y]
      area_def = AreaDefinition('geotiff_area', pcs_id, pcs_id,
                                proj4_str_to_dict(crs),
                                x_size, y_size, area_extent)
      return area_def
docs: Read area definition from a geotiff.