Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong GoogleDisk filenames #15

Open
seidlmic opened this issue Apr 1, 2015 · 0 comments
Open

Wrong GoogleDisk filenames #15

seidlmic opened this issue Apr 1, 2015 · 0 comments

Comments

@seidlmic
Copy link

seidlmic commented Apr 1, 2015

Unless there is some special requiremnets on bbox and maxResolution values (which is not clearly documented) this can happen in getKey function in GoogleDisk.py

def getKey (self, tile):
    grid = tile.layer.grid(tile.z)
    components = ( self.basedir,
                   tile.layer.name,
                   "%s" % int(tile.z),
                   "%s" % int(tile.x),
                   "%s.%s" % (int(grid[1] - 1 - tile.y), tile.layer.extension)
                   )
    filename = os.path.join( *components )
    return filename

grid can have volues
(0.7022093750000402, 1.2695687499997277)
and for tile.y = 0 one will get
int(1.2695687499997277 - 1 - 0)
that leads to 0 but apparently should be 1 becuase there are two rows of tiles. For tile.y = 1
int(1.2695687499997277 - 1 - 1)
leads again to 0 that causes the previous file is overwritten.

For most cases this could be solution.

"%s.%s" % (int(grid[1] - tile.y), tile.layer.extension)

But if grid[1].is_integer() the current formula is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant