Skip to content

Commit 1474050

Browse files
authored
TileDB: Fetch and set band names from TileDB schema attributes (#13787)
1 parent 4272b65 commit 1474050

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

frmts/tiledb/tiledbdense.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,10 +1735,16 @@ GDALDataset *TileDBRasterDataset::OpenInternal(GDALOpenInfo *poOpenInfo,
17351735
// Create band information objects.
17361736
for (int i = 1; i <= poDS->nBands; ++i)
17371737
{
1738-
CPLString osAttr =
1739-
TILEDB_VALUES + CPLString().Printf("_%i", i);
1740-
poDS->SetBand(i,
1741-
new TileDBRasterBand(poDS.get(), i, osAttr));
1738+
tiledb::Attribute const &attr = schema.attribute(i - 1);
1739+
std::string const &attr_name = attr.name();
1740+
1741+
CPLDebug("TileDB", "Set attribute '%s' from TileDB schema",
1742+
attr_name.c_str());
1743+
1744+
GDALRasterBand *band =
1745+
new TileDBRasterBand(poDS.get(), i, attr_name.c_str());
1746+
1747+
poDS->SetBand(i, band);
17421748
}
17431749
}
17441750
else

0 commit comments

Comments
 (0)