<div dir="ltr"><div>Hi all,</div><div><br></div><div>I am attempting to read a single band from a NOAA GRIB2 file on S3, with an associated .idx file. Reading the GRIB2 driver documentation, it is stated that the existence of such an idx file allows a file to be opened without reading all bands.</div><div><br></div><div>However, looking at the CPL_CURL_VERBOSE=True logs, it appears that GDAL is still paging through the file from the start until reaching the requested band.</div><div><br></div><div>GDAL identifies the existence of the .idx file:</div><div><br></div><div>DEBUG:CPLE_None in GRIB: Reading inventories from sidecar file /vsis3/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012.idx<br>DEBUG:CPLE_None in S3: Downloading 0-41215 (<a href="https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012.idx).">https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012.idx).</a>..</div><div><br></div><div>But it then appears to scan the file from the start until it has passed the requested band:</div><div><br></div><div>DEBUG:CPLE_None in S3: Downloading 16384-999423 (<a href="https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).">https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).</a>..</div><div>DEBUG:CPLE_None in S3: Downloading 999424-2965503 (<a href="https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).">https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).</a>..<br>DEBUG:CPLE_None in S3: Downloading 2965504-6897663 (<a href="https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).">https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).</a>..<br>[...]</div><div>DEBUG:S3: Downloading 449626112-450461695 (<a href="https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).">https://s3.amazonaws.com/noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012).</a>..<br><br></div><div>Band 636 is listed in the .idx with offset 443333308, Band 637 having offset 444174665. The total filesize is 545533166.</div><div><br></div><div><br></div><div>Do I need to do something extra to trigger GDAL to read only the requested band based on the .idx? Are some GRIB/.idx files not able to be loaded in this way?</div><div><br></div><div>I am running via rasterio v1.4.3 which is using GDAL v3.9.3. My code is below, the file is in a public NOAA-hosted bucket.</div><div><br></div><div>Cheers,</div><div>Daniel</div><div><br></div><div>###</div><div><br></div>import logging<br>import rasterio<br><br>logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG)<br><br>with rasterio.Env(USE_IDX=True, AWS_VIRTUAL_HOSTING=False, CPL_DEBUG=True, CPL_CURL_VERBOSE=True):<br>    with rasterio.open("s3://noaa-gfs-bdp-pds/gfs.20250918/00/atmos/gfs.t00z.pgrb2.0p25.f012") as ds:<br><div>        band = ds.read(636)</div><div><br></div><div>###</div><div><br></div></div>