def xy_list_to_bbox(xyList):
    """
    Returns a bounding box (x,y,w,h) that will contain the shape
    represented by the XY points list
    """
    xList, yList = [], []
    for xy in xyList:
        x, y = xy
        xList.append(x)
        yList.append(y)
    return min(xList), min(yList), max(xList) - min(xList), max(yList) - min(
        yList)
