@@ -0,0 +1,574 @@
+#!/usr/bin/env python%0A%0Aimport math%0A%0Adef geoToPixel( point, zoom, tilesize=256 ):%0A%09lng = point%5B0%5D%0A%09if lng %3E 180.0: lng -= 360.0%0A%09lng = lng / 360.0 + 0.5%0A%0A%09lat = point%5B1%5D%0A%09lat = 0.5 - ( math.log( math.tan( ( math.pi / 4.0 ) + ( lat * math.pi / 360.0 ) ) ) / math.pi / 2.0 );%0A%09%0A%09scale = ( 1 %3C%3C zoom ) * tilesize%0A%09return %5B int( lng * scale ), int( lat * scale ) %5D%0A%0Aprint geoToPixel( %5B 0.0, 0.0 %5D, 0 ) == %5B 128, 128 %5D%0Aprint geoToPixel( %5B 0.0, 0.0 %5D, 1 ) == %5B 256, 256 %5D%0A%0Aprint geoToPixel( %5B -60.0, 45.0 %5D, 0 ) == %5B 85, 92 %5D%0Aprint geoToPixel( %5B -60.0, 45.0 %5D, 1 ) == %5B 170, 184 %5D%0A

Add geographic coordinte to pixel coordinate converter