import math


def _tileBoundary(x, y, z):
    """Return (left, bottom, right, top) of bbox of given tile"""
    n = 2 ** z
    mercToLat = lambda x: math.degrees(math.atan(math.sinh(x)))
    top = mercToLat(math.pi * (1 - 2 * (y * (1/n))))
    bottom = mercToLat(math.pi * (1 - 2 * ((y+1) * (1/n))))
    left = x * (360/n) -180
    right = left + (360/n)
    return left, bottom, right, top