Skip to content

Instantly share code, notes, and snippets.

@n-kb
Created January 19, 2016 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n-kb/a441b772addd35260a1f to your computer and use it in GitHub Desktop.
Save n-kb/a441b772addd35260a1f to your computer and use it in GitHub Desktop.
# Loops through all zoom levels
for zoom_level in range(4,13):
# Computes all tiles for the whole world
for X in range (0, int(math.pow(2, zoom_level))):
for Y in range (0, int(math.pow(2, zoom_level))):
# Finds the bounds of each tile
N_tile, W_tile = num2deg(X, Y, zoom_level)
S_tile, E_tile = num2deg(X + 1, Y + 1, zoom_level)
#Are we in Europe?
if N_tile < N_max and S_tile > S_max :
if E_tile < E_max and W_tile > W_max:
# Makes the tile...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment