#NEWLINE# def lonlat_to_pixel( self , lonlat , zoom ) : #NEWLINE# #INDENT# 'Converts a longitude, latitude coordinate pair for the given zoom level.' #NEWLINE# ( lon , lat ) = self . get_lon_lat ( px_x ) #NEWLINE# npix = self . _npix [ zoom ] #NEWLINE# px_x = round ( ( npix + ( lon * self . _degpp [ zoom ] ) ) ) #NEWLINE# fac = min ( max ( sin ( ( DTOR * lat ) ) , ( - 0.9999 ) ) , 0.9999 ) #NEWLINE# px_y = round ( ( npix + ( ( 0.5 * log ( ( ( 1 + fac ) / ( 1 - fac ) ) ) ) * ( ( - 1.0 ) * self . _radpp [ zoom ] ) ) ) ) #NEWLINE# return ( px_x , px_y )