load a lower resolution tile from cache to fill in a
        map while waiting for a higher resolution tile

def load_tile_lowres(self, tile):
        '''load a lower resolution tile from cache to fill in a
        map while waiting for a higher resolution tile'''
        if tile.zoom == self.min_zoom:
            return None

        # find the equivalent lower res tile
        (lat,lon) = tile.coord()

        width2 = TILES_WIDTH
        height2 = TILES_HEIGHT

        for zoom2 in range(tile.zoom-1, self.min_zoom-1, -1):
            width2 //= 2
            height2 //= 2

            if width2 == 0 or height2 == 0:
                break

            tile_info = self.coord_to_tile(lat, lon, zoom2)

            # see if its in the tile cache
            key = tile_info.key()
            if key in self._tile_cache:
                img = self._tile_cache[key]
                if np.array_equal(img, np.array(self._unavailable)):
                    continue
            else:
                path = self.tile_to_path(tile_info)
                img = cv2.imread(path)
                if img is None:
                    continue
                # add it to the tile cache
                self._tile_cache[key] = img
                while len(self._tile_cache) > self.cache_size:
                    self._tile_cache.popitem(0)

            # copy out the quadrant we want
            availx = min(TILES_WIDTH - tile_info.offsetx, width2)
            availy = min(TILES_HEIGHT - tile_info.offsety, height2)
            if availx != width2 or availy != height2:
                continue
            roi = img[tile_info.offsety:tile_info.offsety+height2, tile_info.offsetx:tile_info.offsetx+width2]

            # and scale it
            scaled = cv2.resize(roi, (TILES_HEIGHT,TILES_WIDTH))
            #cv.Rectangle(scaled, (0,0), (255,255), (0,255,0), 1)
            return scaled
        return None