def create_cell(project, polygon, height, id=None, with_surfacewater=True):
    """
    Creates a cell from a shapely polygon and stores the geometry in cell.geometry

    :param project: the cmf project of the cell
    :param polygon: the shapely Polygon
    :param height: the height of the cell
    :param id: the id of the cell, only set if not None
    :param with_surfacewater: True, if a surfacewater storage will be created
    :return: The new cell
    """
    center = polygon.centroid.x, polygon.centroid.y, height
    c = project.NewCell(*center, area=polygon.area, with_surfacewater=
        with_surfacewater)
    c.geometry = polygon
    if id is not None:
        c.Id = id
    return c
