def get_extent(gtws):
    """Returns extent of gateways (parameter gtws)."""

    minx = float("inf")
    miny = float("inf")
    maxx = float("-inf")
    maxy = float("-inf")

    for gtw in gtws:
        if gtws[gtw][0] < minx:
            minx = gtws[gtw][0]
        if gtws[gtw][0] > maxx:
            maxx = gtws[gtw][0]
        if gtws[gtw][1] < miny:
            miny = gtws[gtw][1]
        if gtws[gtw][1] > maxy:
            maxy = gtws[gtw][1]

    # print (minx, miny, maxx, maxy)
    return minx, miny, maxx, maxy