MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / num2deg

Function num2deg

PythonAPI/examples/spawn_imagery.py:40–45  ·  view source on GitHub ↗
(zoom, ytile, xtile)

Source from the content-addressed store, hash-verified

38 return (zoom, ytile, xtile)
39
40def num2deg(zoom, ytile, xtile):
41 n = 2.0 ** zoom
42 lon_deg = xtile / n * 360.0 - 180.0
43 lat_rad = math.atan(math.sinh(math.pi * (1 - 2 * ytile / n)))
44 lat_deg = math.degrees(lat_rad)
45 return (lat_deg, lon_deg)
46
47EARTH_RADIUS = 6378137.0 # in meters on the equator
48

Callers 1

spawn_imageryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected