Skip to main content

Function: mergeReads()

mergeReads(reads, options): MergedRange[]

Defined in: merge.ts:40

Group reads into as few contiguous ranges as the options allow.

Reads are taken in offset order, longest first among equals, so a range starts with its widest read. A read that starts before the current range's end joins it unconditionally: it is contained or overlapping, and fetching the overlap twice would cost more than the longer request. A read that starts at or past the end, adjacent reads included (the tiles of a COG row are contiguous), joins only if the gap is at most maxGap, the merged range stays within maxRequestBytes, and the range's over-fetch stays within maxOverfetchBytes.

Parameters​

reads​

readonly ByteRange[]

options​

MergeOptions

Returns​

MergedRange[]