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

Brad Hards bradh at frogmouth.net
Fri Feb 24 21:55:54 PST 2023


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