Skip to content

Wrong GoogleDisk filenames #15

@seidlmic

Description

@seidlmic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions