def PixelsToMeters( px, py, zoom): import math tileSize = 256 initialResolution = 2 * math.pi * 6378137 / tileSize # 156543.03392804062 for tileSize 256 pixels originShift = 2 * math.pi * 6378137 / 2.0 # 20037508.342789244 res = initialResolution/(2**zoom) mx = px * res - originShift my = py * res - originShift return mx, my