forked from datalyze-solutions/globalmaptiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
executable file
·67 lines (53 loc) · 1.3 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python
from globalmaptiles import GlobalMercator
gm = GlobalMercator()
zoom = 7
geographic = {
'lat': 52.31,
'lon': 13.24
}
meters = {
'mx': 1473870.058102942,
'my': 6856372.69101939
}
pixels = {
'px': 17589.134222222223,
'py': 21990.22649522623
}
tile = {
'tx': 68,
'ty': 85
}
googleTile = {
'tx': 68,
'ty': 42
}
tileBounds = {
'minx': 1252344.271424327,
'miny': 6574807.42497772,
'maxx': 1565430.3392804079,
'maxy': 6887893.492833804
}
quadKey = "1202120"
result = gm.LatLonToMeters(geographic['lat'], geographic['lon'])
print(result)
result = gm.MetersToLatLon(meters['mx'], meters['my'])
print(result)
result = gm.MetersToPixels(meters['mx'], meters['my'], zoom)
print(result)
result = gm.PixelsToTile(pixels['px'], pixels['py'])
print(result)
result = gm.PixelsToMeters(pixels['px'], pixels['py'], zoom);
print(result)
result = gm.TileBounds(tile['tx'], tile['ty'], zoom);
print(result)
result = gm.LatLonToTile(geographic['lat'], geographic['lon'], zoom);
print(result)
result = gm.MetersToTile(meters['mx'], meters['my'], zoom);
print(result)
result = gm.GoogleTile(tile['tx'], tile['ty'], zoom);
print(result)
result = gm.QuadTree(tile['tx'], tile['ty'], zoom);
print(result)
tx, ty, zoom = gm.QuadKeyToTile(quadKey);
print(tx, ty, zoom)