[gdal-dev] create ntif file with NITF_IGEOLO field set

Amadeus WM amadeus84 at verizon.net
Sun Feb 26 05:17:11 PST 2023


Thank you so much, it worked! It's a life saver!


I have read the nitf creation issues before even posting here, and I also 
tried to set the options at creation time like this:

    char** opt=nullptr;
    opt=CSLSetNameValue(opt, "NITF_ICORDS", "D");
    opt=CSLSetNameValue(opt, "NITF_IGEOLO", 
"+28.563-080.578+28.563-080.577+28.562-080.577+28.562-080.578");

    GDALDataset* dataset=driver->Create("out.ntf", rows, cols, 1, 
GDT_UInt16, opt);


but I was getting warnings:

Warning 6: driver NITF does not support creation option NITF_ICORDS
Warning 6: driver NITF does not support creation option NITF_IGEOLO


The one thing I had not payed attention to was the "do not put the NITF_ 
prefix" part. That should be written in bold, huge font size and in red.

Again, thank you very much! Problem solved.





On Sun, 26 Feb 2023 16:04:16 +1100, Brad Hards wrote:

> On Sunday, 26 February 2023 2:33:31 PM AEDT Amadeus WM via gdal-dev
> wrote:
>> So I just noticed that if I call
>> 
>> dataset->SetMetadataItem();
>> 
>> then it creates a file out.ntf.aux.xml and whatever fields I set go in
>> there. Both NITF_ICORDS and NITF_IGEOLO are there, and IGEOLO need not
>> be a real value, it gets set to whatever I set it to.
>> 
>> Is there any way to put those fields in out.ntf and not in
>> out.ntf.aux.xml? What determines where they go?
> 
> See https://gdal.org/drivers/raster/nitf.html#creation-issues in
> particular, where it says 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).
> For instance setting “FTITLE=Image of abandoned missile silo south west
> of Karsk” in the creation option list would result in setting of the
> FTITLE field in the NITF file header. Use the official field names from
> the NITF specification document; do not put the “NITF_” prefix that is
> reported when asking the metadata list.
> 
> 
> Try:
> char **papszOptions = NULL;
> papszOptions = CSLSetNameValue( papszOptions, "ICORDS", "D" );
> papszOptions = CSLSetNameValue( papszOptions, "IGEOLO",
> "+28.563-080.578+28.563-080.577+28.562-080.577+28.562-080.578" );
> 
> and pass those options to your Create() call.
> 
> I'll say it again: creation options, not metadata.
> 
> Brad
> 
> 
> _______________________________________________
> gdal-dev mailing list gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list