[gdal-dev] How to build a Raster Attribute Table for a GeoTiff grid file using GDAL API in c only, not c++?

Sam Gillingham gillingham.sam at gmail.com
Sun Jan 19 16:57:50 PST 2014

GeoTiff's do not support Raster Attribute Tables. Try sticking to HFA


On 20 January 2014 12:55, sam sung <samsung460 at gmail.com> wrote:

> Hello, folks,
>  I tried to build a Raster Attribute Table (denoted as RAT below) for a
> GeoTiff raster file(attached as “test.tif”) in C within Visual Studio 2008.
> This C file was compiled through and there was no errors reported.
>  I used GDALSetDefaultRAT function, it was successful. But when I used
> GDALRATCreateColumn function to create RAT fields, it was always report
> errors. I tested how well the c++ file “rfc40_tests_hfa.cpp”
> works(Downloaded from the GDAL forum). I found this code only works on HFA
> driver, i.e., .img grid file, not .tif grid because the same errors occur
> when I changed the driver from “HFA” to “GTiff”,
>   I downloaded and used gdal-110-1500-core.msi, which is gdal 1.10
> version API library for Windows. I worked with C++ under Visual Studio 2008
> professional.
>   I have attached the GeoTiff file as "test.tif" and my C source code
> file "gtiff_rat.c".   I also attached the c++ file “rfc40_tests_hfa.cpp”.
>   My question:   Is GDAL API able to be used to build a Raster Attribute
> Table for GeoTiff raster?
> Any help will be appriciated.
>  Regards,
> Sam
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140120/e44caba6/attachment.html>

More information about the gdal-dev mailing list