[gdal-dev] NSIF with GDAL

Bar Ori Ori.Bar at elbitsystems.com
Mon Aug 31 04:35:21 PDT 2015


What am I trying to do is to create a NSIF file using GDAL and its NITF driver.
When I do it, the file which created looks like having just part of what I need in according to the NSIF standard (I also need few fields which are out of standard).
Moreover, When I am trying to edit this data whether using the creation options, as written at the document, or using setting metadata with the "SetMetadataItem" method of the data set object,
So what happens is that an aux.xml file is created. Then I open my file using FWTool and all metadata is there, but when I remove the xml, all is gone, at least by opening with FWTool.

-----Original Message-----
From: Even Rouault [mailto:even.rouault at spatialys.com] 
Sent: Monday, 31 August 2015 14:01
To: Bar Ori
Cc: gdal-dev at lists.osgeo.org; Ben Saraf Omer
Subject: Re: [gdal-dev] NSIF with GDAL

Le lundi 31 août 2015 12:51:17, Bar Ori a écrit :
> First, thank you for the information about the FWTool, I will try the 
> gisinternals as suggested.
> 
> Second, Sorry, yes...
> This huge document has table with the metadata needed.
> For example (not in the document) , I want to add a field named "CNRTYCODE"
> with the value "US".
> How do I add it as part of my nsf file without any aux.xml file?

I'm not sure to understand: do you mean you want to add a new item of metadata, not specified by the NITF/NISF standards ? Hum, as far as I know, there's no standard way of doing that with NSIF. You could potentially add a custom TRE, or use various user-data areas for that, but this wouldn't be very operatable with non aware readers since basically in NITF only the values of the metadata are written, not the name.

> Is there any documentation how to work with the TRE?

At that point I'm not sure you need TRE. What you're attempting to do is still a bit too vague for me.

Basically to compose a TRE you must look at the doc that specifies its structure and put the values of the field one after the other, with the documented format and padding. The values can then be used as a GDAL creation option. 

In the GDAL autotest suite, you've a few (fake) examples of how to write TRE :

https://trac.osgeo.org/gdal/browser/trunk/autotest/gdrivers/nitf.py#L1500

> 
> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at spatialys.com]
> Sent: Monday, 31 August 2015 13:25
> To: Bar Ori
> Cc: gdal-dev at lists.osgeo.org; Ben Saraf Omer
> Subject: Re: [gdal-dev] NSIF with GDAL
> 
> Le lundi 31 août 2015 12:17:17, Bar Ori a écrit :
> > The metadata I am trying to add is according to " STANAG 4545 
> > /AEDP-4 NATO Secondary Imagery Format (NSIF)"
> > (http://www.nato.int/structur/ac/224/standard/4545/4545_documents/45
> > 45
> > _ed1
> > _amd1.pdf)
> 
> Pointing at a 160 page long document isn't really what I'm calling to 
> be "specific" ;-) Which fields are you trying to write ?
> 
> > I read about the TRE at http://gdal.org/frmt_nitf_advanced.html
> > but didn't understood exactly how to work with it in my code. But 
> > again, will it be saved on the file itself or on external file? My 
> > goal is to have all in one nsf file.
> 
> It will be written in the file. Composing TRE isn't admitedly obvious. 
> It requires
> 
> > P.S. for viewing the metadata, I am using the FWTool, do you think 
> > maybe there is the problem? Maybe this tool cannot read it from the 
> > file even when exists?
> 
> Hum, FWTools is really deprecated and hasn't been updated in years, 
> although I would think it should be able to read, at least the main 
> metadata fields.
> 
> I'd recommend using up-to-date builds at http://gisinternals.com/ rather.
> Especially for the writing part, since some of the improvements in the 
> NITF driver must be posterior to the latest FWTools version.
> 
> > Thanks, Ori.
> > 
> > -----Original Message-----
> > From: Even Rouault [mailto:even.rouault at spatialys.com]
> > Sent: Monday, 31 August 2015 12:42
> > To: Bar Ori
> > Cc: gdal-dev at lists.osgeo.org; Ben Saraf Omer
> > Subject: Re: [gdal-dev] NSIF with GDAL
> > 
> > Le lundi 31 août 2015 11:21:51, vous avez écrit :
> > > Hi Even,
> > > Thanks for your quick response.
> > > I have already read and worked according to this document
> > > (http://gdal.org/frmt_nitf.html) Still, after removing the aux.xml 
> > > file, the data is gone with it.
> > 
> > That's a bit surprising. See:
> > 
> > $ gdal_translate -q byte.tif byte.ntf -of NITF -co FTITLE=foo -a_srs
> > EPSG:32611 $ rm byte.ntf.aux.xml $ gdalinfo byte.ntf | grep FTITLE 
> > NITF_FTITLE=foo
> > 
> > > Moreover, this document talks about specific info which is 
> > > relevant to NITF header, but I have an additional information that 
> > > is not part of NITF (my metadata is relevant to NSIF - STANAG 4545).
> > 
> > It is a bit difficult to comment as you're not very specific about 
> > which exact info you're trying to write.
> > 
> > You've the possibility to write content of TREs (for most of them 
> > you'll have to compose it manually) in file or image subheaders with 
> > the TRE= and FILE_TRE= creation options.
> > 
> > Even
> > 
> > --
> > Spatialys - Geospatial professional services 
> > http://www.spatialys.com
> > 
> > The information in this e-mail transmission contains proprietary and 
> > business sensitive information.  Unauthorized interception of this 
> > e-mail may constitute a violation of law. If you are not the 
> > intended recipient, you are hereby notified that any review, 
> > dissemination, distribution or duplication of this communication is 
> > strictly prohibited. You are also asked to contact the sender by 
> > reply email and immediately destroy all copies of the original message.
> 
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
> 
> The information in this e-mail transmission contains proprietary and 
> business sensitive information.  Unauthorized interception of this 
> e-mail may constitute a violation of law. If you are not the intended 
> recipient, you are hereby notified that any review, dissemination, 
> distribution or duplication of this communication is strictly 
> prohibited. You are also asked to contact the sender by reply email 
> and immediately destroy all copies of the original message.

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the gdal-dev mailing list