'Converts a longitude, latitude coordinate pair for the given zoom level.'

def lonlat_to_pixel(self, lonlat, zoom):

    (lon, lat) = self.get_lon_lat(lonlat)
    npix = self._npix[zoom]
    px_x = round((npix + (lon * self._degpp[zoom])))
    fac = min(max(sin((DTOR * lat)), (-0.9999)), 0.9999)
    px_y = round((npix + ((0.5 * log(((1 + fac) / (1 - fac)))) * ((-1.0) * self._radpp[zoom]))))
    return (px_x, px_y)
