[Gdal-dev] Metadata preservation (or lack thereof) in NITF driver

Ozy Sjahputera sjahputerao at missouri.edu
Tue Jul 24 11:23:15 EDT 2007


I was using :

gdal_translate -of nitf src.ntf dst.ntf

The input file, src.ntf, contains some metadata items such as the RPC 
parameters (important to have if you want to do orthorectification). 
However, the result of gdal_translate above, dst.ntf, does not contain 
any of the RPC parameters. 

I wrote a simple program to do something similar:
   
    GDALDataset *srcDs = (GDALDataset*) GDALOpen( srcfname.c_str(), 
GA_ReadOnly);
    char **papszCreateOptions = NULL;
    papszCreateOptions = srcDs->GetMetadata();
    GDALDriver *hDriver = (GDALDriver*) GDALGetDriverByName( "nitf" );
    GDALDataset *dstDs = hDriver->CreateCopy(dstfname.c_str(), srcDs, 
TRUE, papszCreateOptions, NULL, NULL);

Note that I specifically fetched the source image metadata and passed it 
to CreateCopy.  I also specified bStrict = TRUE since I want the copy to 
be equivalent (just to prove a point). Even with this code the output 
image still does not contain any RPC parameter.

Any info on how to deal with this? 

Thanks.

Ozy



More information about the Gdal-dev mailing list