I am trying to make a code to read and retrieve geographical and raster data from a GeoTIFF file, but I'm having a hard time with the extended tags. I have no problem with the regular TIFF tags (like IMAGEWIDTH, using tiffgetfield()) or the geokeys (like ProjectedCSTypeGeoKey, using GTIFKeyGet() or taking it from the definition struct), but what's giving me problem are the extended tags provided by geotiff library.
I can see the information I need (pixel scale and tie point tags) using GTIFPrint(), but I don't know how to access the metadata file, and haven't been able to get the data I want using TIFFGetField() since I can't call the function properly.
This is how I was calling TIFFGetField
double* pixscl; int* pixscalesize; TIFFGetField(tif, GTIFF_TIEPOINTS, &pixscalesize); printf("Model Pixel Scale Tag is:\n %d\n", pixscalesize);
What I'm getting here is the number of elements in the tag, which is 3 for pixel scale, and 6 for tie point, but still have no access to the actual values.
Any ideas on how I can store the values of these tags to print or use in another function?
PS: I am using only libgeotiff, GDAL is out of discussion because all of its components, and I'm aiming to a light weight and simple application.