def _make_area(area_id, description, proj_id, proj_dict, shape, area_extent,
    **kwargs):
    """Handles the creation of an area definition for create_area_def."""
    from pyresample.geometry import AreaDefinition
    from pyresample.geometry import DynamicAreaDefinition
    optimize_projection = kwargs.pop('optimize_projection', False)
    resolution = kwargs.pop('resolution', None)
    height, width = None, None
    if shape is not None:
        height, width = shape
    if None not in (area_extent, shape):
        return AreaDefinition(area_id, description, proj_id, proj_dict,
            width, height, area_extent, **kwargs)
    return DynamicAreaDefinition(area_id=area_id, description=description,
        projection=proj_dict, width=width, height=height, area_extent=
        area_extent, rotation=kwargs.get('rotation'), resolution=resolution,
        optimize_projection=optimize_projection)
