Ozy,

You can't set the RPC parameters this way as they are not contained in the main file header or imagery header, but they are derived from the RPC00A or RPC00B TRE. So you could set them by using the TRE=RPC00A=xxxxxx or TRE=RPC00B=xxxxxxxx creation options. You can get the xxxxxx value from src_ds->GetMetataItem("RPC00A", "TRE") (or "RPC00B" depending on your NITF source file)

Folks,

I need to create a new NITF image and set some RPC parameters I grabbed from another NITF file. According to the online documentation (http://www.gdal.org/frmt_nitf.html):

"Most file header, imagery header metadata and security fields can be set with appropriate *creation options* (although they are reported as metadata item, but must not be set as metadata)."

So I did the following:

1   char **create_options = NULL;
2 GDALDataset* ds = (GDALDataset*) GDALOpen( existing_nitf_file, GA_ReadOnly ); 3 create_options = CSLSetNameValue( create_options, "RPC_LINE_OFF", ds->GetMetadataItem( "LINE_OFF", "RPC" ) );
4   GDALDriver *driver = GetGDALDriverManager()->GetDriverByName("NITF");
5 GDALDataset* out_ds= driver->Create( new_nitf_file, width, height, bandCount(), GDT_UInt16, create_options );

During execution, I am getting the following warning message:

Warning 6: Driver NITF does not support RPC_LINE_OFF creation option

I also tried using "LINE_OFF" in line 2 as the metadata key and still getting the same warning.

When I processed the newly created nitf file, calling GetMetadataItem("RPC_LINE_OFF",NULL) or GetMedataItem("LINE_OFF", "RPC") returns NULL. So the metadata was not set.

Did I misunderstood the documentation above that talks about setting imagery header metadata via create options?

I use GDAL v.1.6.3.

Thanks
Ozy


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev





_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to