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

Ozy Sjahputera sjahputerao at missouri.edu
Tue Jul 24 14:38:57 EDT 2007


Thanks, Frank.
Are you aware of other NITF driver in C/C++ that preserves the original 
metadata (most importantly RPC parameters)?
oz

Frank Warmerdam wrote:
> Ozy Sjahputera wrote:
>> 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.
>
> Ozy,
>
> The NITF driver just doesn't support writing RPC info.
>
> The bStrict flag is not well adhered to by drivers.  You should pass it
> as a hint to drivers rather than expecting them to truely be "strict".
>
> I have recently incorporated the ability to write BLOCKA stuff from
> metadata in the NITF driver, but generally speaking the NITF driver
> writes only a fairly simple subset of possible NITF information though
> the reader tries to be more general.
>
> Best regards,




More information about the Gdal-dev mailing list