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

Amadeus WM amadeus84 at verizon.net
Sat Feb 25 19:33:31 PST 2023


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?




On Sat, 25 Feb 2023 16:55:54 +1100, Brad Hards wrote:

> On Saturday, 25 February 2023 4:44:10 PM AEDT Amadeus WM via gdal-dev
> wrote:
>> Hello everyone,
>> 
>> I'm new to GDAL and I'm trying to figure out how to create a NITF file
>> given the raw data, that also has the NITF_IGEOLO field set. With a
>> little help from chatGPT I came up with the c++ program below (it has
>> to be in c++). It writes the file, but it does not contain the
>> NITF_IGEOLO field. I do set it in the code with
>> GDALDataset::SetMetadataItem() and it does appear to be set in the
>> metadata. It just does not show up in the output file, when I inspect
>> it with gdalinfo -mdd all.
> 
> Probably you need to set it to a real value, and also set the ICORDS
> value that corresponds.
> 
> I'm not doing it in C++, but a snippet in python:
> 
>     dst_ds = driver.CreateCopy("out.nitf", dataset, strict=0,
>                                options=["IC=C8", "FDT=20221129010203",
> "FSCLSY=AS", "ISCLSY=AS", "IDATIM=20210617160900", "ICORDS=D",
> "IGEOLO=+28.563-080.578+28.563-080.577+28.562-080.577+28.562-080.578",
> "ICOM=...."])
>     dst_ds = None
> 
> Brad




More information about the gdal-dev mailing list