def get_reference ( self , conf ) :
tilex = self.lon2tilex( conf.lon , conf.zoom )
tiley = self.lat2tiley( conf.lat , conf.zoom )
- return ( tilex[1] , tiley[1] ) , ( tilex[0] , tiley[0] )
+ tile = tilex[1] , tiley[1]
+ pix = tilex[0] , tiley[0]
+ return map( int , tile ) , map( lambda x : int( self.tilesize * x ) , pix )
def lon2tilex ( self , lon , zoom ) :
- return map( int , math.modf( ( lon + 180 ) / 360 * 2 ** zoom ) )
+ return math.modf( ( lon + 180 ) / 360 * 2 ** zoom )
def lat2tiley ( self , lat , zoom ) :
lat = lat * math.pi / 180
- return map( int , math.modf( ( 1 - math.log( math.tan( lat ) + 1 / math.cos( lat ) ) / math.pi ) / 2 * 2 ** zoom ) )
+ return math.modf( ( 1 - math.log( math.tan( lat ) + 1 / math.cos( lat ) ) / math.pi ) / 2 * 2 ** zoom )
def get_tile ( self , tile ) :
file = self.tilepath( self.reftile[0] + tile[0] , self.reftile[1] + tile[1] )