Skip to content

Conversation

@hobu
Copy link
Contributor

@hobu hobu commented Jan 27, 2026

What does this PR do?

TileDB uses TILEDB_ATTRIBUTE as a config option, which I think was meant to support setting a series of subdataset band names. The scheme doesn't work so well when each attribute has its own name. I have included a zip file of a TileDB instance demonstrating such a scenario.

Existing issues:

  • fill_value for the attribute is not set on the RasterBands. It seems the first band is defaulted (or fetched) to 0, but subsequent ones are not captured
  • ColorInterp is not configured. The first three bands default to RGB, and then the subsequent ones are all Alpha

@hobu
Copy link
Contributor Author

hobu commented Jan 27, 2026

@normanb I'm hoping for some guidance if you have a moment to spare on this. I'm confused about whether this is the correct fix, and how we should be getting/setting fill_values from Attributes.

You can fetch a copy of the TDB at https://s3.amazonaws.com/hobu-lidar/western-us.tdb.zip

@hobu
Copy link
Contributor Author

hobu commented Jan 27, 2026

Output after applying my patch:

TileDB: Set attribute 'count' from TileDB schema
TileDB: Set attribute 'shatter_process_num' from TileDB schema
TileDB: Set attribute 'start_time' from TileDB schema
TileDB: Set attribute 'end_time' from TileDB schema
TileDB: Set attribute 'Z' from TileDB schema
TileDB: Set attribute 'Intensity' from TileDB schema
TileDB: Set attribute 'm_Z_mean' from TileDB schema
TileDB: Set attribute 'm_Intensity_mean' from TileDB schema
TileDB: Set attribute 'm_Z_max' from TileDB schema
TileDB: Set attribute 'm_Intensity_max' from TileDB schema
TileDB: Set attribute 'm_Z_min' from TileDB schema
TileDB: Set attribute 'm_Intensity_min' from TileDB schema
TileDB: Set attribute 'm_Z_p75' from TileDB schema
TileDB: Set attribute 'm_Intensity_p75' from TileDB schema
GDAL: GDALOpen(western-us.tdb, this=0xb5f1dc000) succeeds as TileDB.
Driver: TileDB/TileDB
GDAL: GDALDefaultOverviews::OverviewScan()
Files: /Users/hobu/dev/git/gdal/western-us.tdb/western-us.tdb
       /Users/hobu/dev/git/gdal/western-us.tdb
Size is 5, 5
Coordinate System is:
PROJCRS["NAD83 / UTM zone 11N",
    BASEGEOGCRS["NAD83",
        DATUM["North American Datum 1983",
            ELLIPSOID["GRS 1980",6378137,298.257222101,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",4269]],
    CONVERSION["UTM zone 11N",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-117,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",0.9996,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["easting",east,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["northing",north,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    ID["EPSG",26911]]
Data axis to CRS axis mapping: 1,2
Origin = (569985.000000000000000,5054985.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  DATASET_TYPE=raster
  DATA_TYPE=Float32
  INTERLEAVE=BAND
  NBITS=8
  X_SIZE=5
  Y_SIZE=5
Corner Coordinates:
Upper Left  (  569985.000, 5054985.000) (116d 6' 6.86"W, 45d38'41.58"N)
Lower Left  (  569985.000, 5054835.000) (116d 6' 6.94"W, 45d38'36.72"N)
Upper Right (  570135.000, 5054985.000) (116d 5'59.93"W, 45d38'41.52"N)
Lower Right (  570135.000, 5054835.000) (116d 6' 0.01"W, 45d38'36.66"N)
Center      (  570060.000, 5054910.000) (116d 6' 3.43"W, 45d38'39.12"N)
Band 1 Block=5x5 Type=Float32, ColorInterp=Red
  Description = count
  NoData Value=0
Band 2 Block=5x5 Type=Float32, ColorInterp=Green
  Description = shatter_process_num
Band 3 Block=5x5 Type=Float32, ColorInterp=Blue
  Description = start_time
Band 4 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = end_time
Band 5 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = Z
Band 6 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = Intensity
Band 7 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Z_mean
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 8 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Intensity_mean
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 9 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Z_max
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 10 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Intensity_max
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 11 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Z_min
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 12 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Intensity_min
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 13 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Z_p75
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
Band 14 Block=5x5 Type=Float32, ColorInterp=Alpha
  Description = m_Intensity_p75
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
ERROR 1: Attribute: Cannot get fill value; Attribute is nullable
GDAL: GDALClose(/Users/hobu/dev/git/gdal/western-us.tdb, this=0xb5f1dc000)
GDAL: In GDALDestroy - unloading GDAL shared library.

@normanb
Copy link
Contributor

normanb commented Jan 30, 2026

@hobu I can take a look at this. TILEDB_ATTRIBUTES was meant as a way of using subdatasets in particular for converting from netCDF and HDF which is now better handled with GDAL multidim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants