

def _match_overlay(self, raster, overlay_spec):
    '\n        Given a raster or input overlay, generate a list of matched\n        elements (None if no match) and corresponding tuple of match\n        strength values.\n        '
    ordering = ([None] * len(overlay_spec))
    strengths = ([0] * len(overlay_spec))
    elements = (raster.values() if isinstance(raster, Overlay) else [raster])
    for el in elements:
        for pos in range(len(overlay_spec)):
            strength = self._match(el, overlay_spec[pos])
            if (strength is None):
                continue
            elif (strength <= strengths[pos]):
                continue
            else:
                ordering[pos] = el
                strengths[pos] = strength
    return (ordering, strengths)

dataset/ETHPy150Open ioam/holoviews/holoviews/operation/element.py image_overlay._match_overlay/original