def geoPointInsideBox(p, edges):
    """
    returns True only if p lies inside or on the sides of box
    """
    y,x = p
    (y0,x0),(y1,x1) = edges
    if y0>y1:
        y0,y1 = y1,y0
    if x0>x1:
        x0,x1 = x1,x0

    return x0<=x<=x1 and y0<=y<=y1