Created
April 24, 2022 14:27
-
-
Save kuwapa/54795471e9070ec6fcf3c3450ae66254 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getTotalTileCount(leftBottom, rightTop, fromZoom, toZoom): | |
totalTileCount = 0 | |
for zoom in range(fromZoom, toZoom + 1): | |
leftBottomTiles = deg2num(leftBottom, zoom) | |
rightTopTiles = deg2num(rightTop, zoom) | |
currentTileCount = (rightTopTiles[0] - leftBottomTiles[0] + 1) * (leftBottomTiles[1] - rightTopTiles[1] + 1) | |
print("zoom = " + str(zoom) + ", leftBottomTiles = " + str(leftBottomTiles) + | |
", rightTopTiles = " + str(rightTopTiles) + ", tileCount = " + str(currentTileCount)) | |
totalTileCount += currentTileCount | |
return totalTileCount |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment