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

Amadeus WM amadeus84 at verizon.net
Sat Feb 25 14:26:57 PST 2023


Yes, I tried it in python and it works, but it needs to be in C++. 

Following your suggestion, I changed my code like so:

    dataset->SetMetadataItem("NITF_ICORDS", "D");
    dataset->SetMetadataItem("NITF_IGEOLO", 
"+28.563-080.578+28.563-080.577+28.562-080.577+28.562-080.578");

Again, NITF_ICORDS and NITF_GEOLO do get printed in the loop in the code, 
but don't make it in the output file, so no joy yet.




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