[gdal-dev] create ntif file with NITF_IGEOLO field set
Brad Hards
bradh at frogmouth.net
Sat Feb 25 21:04:16 PST 2023
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
More information about the gdal-dev
mailing list