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

sam sung samsung460 at gmail.com
Sun Jan 19 15:55:27 PST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140120/38dd4280/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdal_built_RAT.rar
Type: application/rar
Size: 5047 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140120/38dd4280/attachment-0001.rar>


More information about the gdal-dev mailing list