Select appropriate overview given the strategy.
Select appropriate overview given the strategy.
WARN: this function assumes that CellSizes are sorted by their resolution, with "smaller" cell sizes appearing first. It interprets idx 0 as the position with the highest CellSize. If the input list is not sorted, this function returns idx 0.
Unless a particular strategy suggests otherwise, this method will clamp the returned index to the range of overviewCS.
a list of CellSizes sorted by resolution
, result is undefined for unsorted lists.
cellSize that would be searched
overview strategy used to search for the best matching CellSize
index of the closest cellSize. Each strategy defines a different behavior: Level: selects the passed index and if it is OOB clamps the index. Auto(n): selects the best matching cellSize (approximately) and adds n, requires the input resolutions list to be sorted. Base: always returns the best matching cellSize from the given list of CellSizes. AutoHigherResolution: selects the best matching cellSize (approximately) always selects a higher resolution, requires the input resolutions list to be sorted.