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

Function deg2num

PythonAPI/examples/spawn_imagery.py:33–38  ·  view source on GitHub ↗
(zoom, lat_deg, lon_deg)

Source from the content-addressed store, hash-verified

31VERTICAL_OFFSET = -0.1
32
33def deg2num(zoom, lat_deg, lon_deg):
34 lat_rad = math.radians(lat_deg)
35 n = 2.0 ** zoom
36 xtile = int((lon_deg + 180.0) / 360.0 * n)
37 ytile = int((1.0 - math.asinh(math.tan(lat_rad)) / math.pi) / 2.0 * n)
38 return (zoom, ytile, xtile)
39
40def num2deg(zoom, ytile, xtile):
41 n = 2.0 ** zoom

Callers 1

spawn_imageryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected