[gdal-dev] Raster attributes tables with URL raster
Kirk Waters - NOAA Federal
kirk.waters at noaa.gov
Tue Dec 16 12:32:48 PST 2025
Dear GDAL gurus,
I'm struggling a little with raster attribute tables if the file is remote.
They don't seem to be recognized. For example, there is a file (
https://noaa-ocs-nationalbathymetry-pds.s3.amazonaws.com/BlueTopo/BC26826R/BlueTopo_BC26826R_20241023.tiff)
with a side-car *.aux.xml file that has a RAT for band 3. If I pull down
those two files locally and run gdalinfo on it, I can see the RAT. If I do
the same with the URL, no attributes show. My goal is to grab the RAT in
python, but this test script also gets nothing for each band (each band has
a NoneType RAT instead of a gdal.RasterAttributeTable).
from osgeo import gdal
gdal.UseExceptions()
url='
https://noaa-ocs-nationalbathymetry-pds.s3.amazonaws.com/BlueTopo/BC26826R/BlueTopo_BC26826R_20241023.tiff
'
ds = gdal.Open(url)
for band_id in range(ds.RasterCount):
band = ds.GetRasterBand(band_id+1)
rat = band.GetDefaultRAT()
print(f"Band {band_id+1} has rat type {type(rat)}")
Is there something I'm doing wrong? I've tried the various options for
GDAL_DISABLE_READDIR_ON_OPEN, but they haven't changed the result.
Thanks,
Kirk Waters, PhD
NOAA Office for Coastal Management
Applied Sciences Program
coast.noaa.gov/digitalcoast
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251216/c8086303/attachment.htm>
More information about the gdal-dev
mailing list