

def gettile(self, x, y, z, id=None, title=None, srs=None, mimetype=None, timeout=None):
    if ((not id) and (not title) and (not srs)):
        raise ValueError('either id or title and srs must be specified')
    if id:
        return self._gettilefromset(self.contents[id].tilemap.tilesets, x, y, z, self.contents[id].tilemap.extension, timeout=timeout)
    elif (title and srs):
        for tm in self.contents.values():
            if ((tm.title == title) and (tm.srs == srs)):
                if mimetype:
                    if (tm.tilemap.mimetype == mimetype):
                        return self._gettilefromset(tm.tilemap.tilesets, x, y, z, tm.tilemap.extension, timeout=timeout)
                else:
                    return self._gettilefromset(tm.tilemap.tilesets, x, y, z, tm.tilemap.extension, timeout=timeout)
        else:
            raise ValueError(('cannot find %s with projection %s for zoomlevel %i' % (title, srs, z)))
    elif (title or srs):
        ValueError('both title and srs must be specified')
    raise ValueError(('Specified Tile with id %s, title %s\n                projection %s format %s at zoomlevel %i cannot be found' % (id, title, srs, format, z)))

dataset/ETHPy150Open geopython/OWSLib/owslib/tms.py TileMapService.gettile/original