I have a raster (GeoTIFF .tif file) that is stored in three bands (Red, Green, Blue), with each band's data type as a byte. I have a separate color table in the form of a .csv file, that stores a height value (in meters), a Red value, Green value, and Blue value on each line. I need to able to utilize this color table to interpret the RGB values in the raster as raw height values. I am using C# bindings of GDAL, OGR and OSR. How do I get the file loaded so that it can be represented as a GDAL color table?
I know OGR has a CSV driver which you can use to Open the file, which I have done. This creates a DataSource object. But I have no idea how to convert this DataSource to a GDAL ColorTable (if it is even possible). Or is another method needed, such as reading the file line by line manually?