Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

DZone's Guide to

# Converting Between 2 Google Map Tile Types

·
Free Resource

Comment (0)

Save
{{ articles[0].views | formatCount}} Views
```Google maps is a marvelous app.
I try to program a prototype of it on pys60
http://bigbold.com/snippets/posts/show/458

There I only show the default map, not the satellite images.
Retrieving a different mode isn't that difficult.
I read the info from here
http://intepid.com/2005-07-17/21.50/
Then I begin comparing the 2 tile types of the same area
(around California)

Here's the conversion routine between x,y,zoom and quadtree
```
out = []
m = {(0,0):'q', (0,1):'t', (1,0):'r', (1,1):'s'}
for i in range(17-zoom):
x, rx = divmod(x, 2)
y, ry = divmod(y, 2)
out.insert(0, m[(rx,ry)])
return 't' + ''.join(out)
```
Then to convert back
```
x, y, z = 0, 0, 17
m = {'q':(0,0), 't':(0,1), 'r':(1,0), 's':(1,1)}
x = x*2 + m[c][0]
y = y*2 + m[c][1]
z -= 1
return x, y, z
```
Using them is simple
```
'tqtsqrqt'
>>> xyzoom('tqtsqrqt')
(20, 49, 10)
``````
Topics:

Comment (0)

Save
{{ articles[0].views | formatCount}} Views

Opinions expressed by DZone contributors are their own.