def tile_bounds(tsinfo, z, x, y, width=1, height=1):
    """
    Get the coordinate boundaries for the given tile.

    Parameters:
    -----------
    tsinfo: { min_pos: [], max_pos [] }
        Tileset info containing the bounds of the dataset
    z: int
        The zoom level
    x: int
        The x position
    y: int
        The y position
    width: int
        Return bounds for a region encompassing multiple tiles
    height: int
        Return bounds for a region encompassing multiple tiles
    """
    min_pos = tsinfo["min_pos"]
    max_pos = tsinfo["max_pos"]

    max_width = max(max_pos[0] - min_pos[0], max_pos[1] - min_pos[1])

    tile_width = max_width / 2 ** z
    from_x = min_pos[0] + x * tile_width
    to_x = min_pos[0] + (x + width) * tile_width

    from_y = min_pos[1] + y * tile_width
    to_y = min_pos[1] + (y + height) * tile_width

    return [from_x, from_y, to_x, to_y]