getGDALMetadata(sample = null) {
    const metadata = {};
    if (!this.fileDirectory.GDAL_METADATA) {
      return null;
    }
    const string = this.fileDirectory.GDAL_METADATA;

    let items = findTagsByName(string, 'Item');

    if (sample === null) {
      items = items.filter((item) => getAttribute(item, 'sample') === undefined);
    } else {
      items = items.filter((item) => Number(getAttribute(item, 'sample')) === sample);
    }

    for (let i = 0; i < items.length; ++i) {
      const item = items[i];
      metadata[getAttribute(item, 'name')] = item.inner;
    }
    return metadata;
  }
Returns the parsed GDAL metadata items.

If sample is passed to null, dataset-level metadata will be returned.
Otherwise only metadata specific to the provided sample will be returned.

@param {number} [sample=null] The sample index.
@returns {Object}