def g_id_to_bbox(g_id, mesh_size, x_grid_origin=0.0, y_grid_origin=0.0,
    precision=8):
    """
    This fucntion return the bbox associate to a given g_id (grid id).
    If the grid origin is different to 0. you have to indicate the origin's coordinates (x_grid_origin or y_grid_origin)

    :param g_id: grid mesh identifier
    :param mesh_size: size of mesh
    :param x_grid_origin: coordinate in x of grid origin point
    :param y_grid_origin: coordinate in y of grid origin point
    :param precision: is the number of digits after the decimal point that we want keep.
    :return: bbox of g_id
    """
    x_id, y_id = g_id
    x_id, y_id = float(x_id), float(y_id)
    bbox_x_min = x_id * mesh_size
    bbox_x_max = (x_id + 1) * mesh_size
    bbox_y_min = y_id * mesh_size
    bbox_y_max = (y_id + 1) * mesh_size
    if x_grid_origin != 0.0 or y_grid_origin != 0.0:
        bbox_x_min = x_grid_origin + bbox_x_min
        bbox_x_max = x_grid_origin + bbox_x_max
        bbox_y_min = y_grid_origin + bbox_y_min
        bbox_y_max = y_grid_origin + bbox_y_max
    if precision:
        return round(bbox_x_min, precision), round(bbox_y_min, precision
            ), round(bbox_x_max, precision), round(bbox_y_max, precision)
    else:
        return round(bbox_x_min), round(bbox_y_min), round(bbox_x_max), round(
            bbox_y_max)
