[Gdal-dev] Providing supplemental information to GDALOpen()

Robert Banfield rbanfield at weogeo.com
Fri Jul 27 14:42:53 EDT 2007


Hello,

Suppose I have a .jpg file with no corresponding .jgw file, but I know 
all of the transform values.  Is it possible through the API to provide 
supplemental information after GDALOpen() opens this file?

double Transform[6] = ...  // Provide what would have been provided in 
the .jgw file
GDALDatasetH hSrcDS = GDALOpen (MyFile, GA_ReadOnly);  // No .jgw file 
on disk
GDALSetGeoTransform(hSrcDS,Transform);  // I tried this with no success

When I use GDALSetGeoTransform in this fashion I obtain the following:  
CPL Failure 6: SetGeoTransform() not supported for this dataset.  When I 
use GDALOpen(MyFile, GA_Update), I am seg faulting... I haven't yet 
looked at what the cause of that may be...

My goal is simply to "pretend" the world file was already on disk, so 
that later code to generate new data files is correct.

Thank you very much,
Robert



More information about the Gdal-dev mailing list