Hi,
> Can
> anybody please help me how to compute in Java lat & lon from xtile,
> ytile & zoom?
public static double tileYToLat(int zoom, int y) {
if ((zoom < 3) || (zoom > 18)) return Double.MIN_VALUE;
return Math.atan(Math.sinh(Math.PI - (Math.PI*y /
(1<<(zoom-1))))) * 180 / Math.PI;
}
public static double tileXToLon(int zoom, int x) {
if ((zoom < 3) || (zoom > 18)) return Double.MIN_VALUE;
return x * 45.0 / (1<<(zoom-3)) - 180.0;
}
Bye
Frederik
_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev