<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
        {mso-style-name:x_msonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xmsolistparagraph, li.xmsolistparagraph, div.xmsolistparagraph
        {mso-style-name:x_msolistparagraph;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xmsonormal0, li.xmsonormal0, div.xmsonormal0
        {mso-style-name:x_msonormal0;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xxmsonormal, li.xxmsonormal, div.xxmsonormal
        {mso-style-name:x_xmsonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xxxmsonormal, li.xxxmsonormal, div.xxxmsonormal
        {mso-style-name:x_xxmsonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xxxxmsonormal, li.xxxxmsonormal, div.xxxxmsonormal
        {mso-style-name:x_xxxmsonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xmsochpdefault, li.xmsochpdefault, div.xmsochpdefault
        {mso-style-name:x_msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.xmsohyperlink
        {mso-style-name:x_msohyperlink;
        color:blue;
        text-decoration:underline;}
span.xmsohyperlinkfollowed
        {mso-style-name:x_msohyperlinkfollowed;
        color:purple;
        text-decoration:underline;}
span.xhtmlpreformattedchar
        {mso-style-name:x_htmlpreformattedchar;
        font-family:Consolas;}
span.xemailstyle25
        {mso-style-name:x_emailstyle25;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle33
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1855848454;
        mso-list-template-ids:1246768934;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>I think it should check the “type” value. My “maybe this could work” concept was something like:<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>--- a/gdal/frmts/nitf/nitffile.c<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+++ b/gdal/frmts/nitf/nitffile.c<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>@@ -2150,6 +2150,8 @@ static char** NITFGenericMetadataReadTREInternal(char **papszMD,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>             const char* pszName = CPLGetXMLValue(psIter, "name", NULL);<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>             const char* pszLongName = CPLGetXMLValue(psIter, "longname", NULL);<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>             const char* pszLength = CPLGetXMLValue(psIter, "length", NULL);<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+            const char* pszType = CPLGetXMLValue(psIter, "type", "string");<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>             int nLength = -1;<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>             if (pszLength != NULL)<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>                 nLength = atoi(pszLength);<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>@@ -2219,7 +2221,17 @@ static char** NITFGenericMetadataReadTREInternal(char **papszMD,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'> <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>                 if (psOutXMLNode != NULL)<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>                 {<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>-                    const char* pszVal = strchr(papszMD[(*pnMDSize) - 1], '=') + 1;<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                    <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                    char* pszVal = strchr(papszMD[(*pnMDSize) - 1], '=') + 1;<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                    if (strcmp(pszType, "IEEE754") == 0) <o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                    {<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                        // TODO: fix<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                        printf("IEEE754: 0x%02x 0x%02x 0x%02x 0x%02x\n", pszVal[0], pszVal[1], pszVal[2], pszVal[3]);<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                        pszVal = "FIXME1";<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                    } else if (strcmp(pszType, "UINT") == 0) {<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                        printf("UINT: 0x%02x 0x%02x 0x%02x 0x%02x\n", pszVal[0], pszVal[1], pszVal[2], pszVal[3]);<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                        pszVal = "FIXME2";<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>+                    }<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>                     CPLXMLNode* psFieldNode;<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>                     CPLXMLNode* psNameNode;<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>                     CPLXMLNode* psValueNode;<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>(I think the pzVal might need to be changed to a union / class that has char*, a double or an unsigned int; I haven’t dug further than this yet).<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Brad<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> Edson, Adam Robert <are131@psu.edu> <br><b>Sent:</b> Thursday, 7 November 2019 6:34 AM<br><b>To:</b> Brad Hards <bradh@frogmouth.net>; gdal-dev@lists.osgeo.org<br><b>Cc:</b> Bradley, Eliza S <esb165@psu.edu><br><b>Subject:</b> Re: [gdal-dev] python GDAL issue<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:12.0pt;color:black'>Looking at the code, it appears that GDAL actually hard codes any TRE that takes anything that cannot be parsed as a string (e.g. nitfimage.c NITFReadICHIPB). So, for BANDSB with its EXISTENCE_MASK and SCALE_FACTOR would need to be hard coded as opposed to being defined just within the nitf_spec.xml. Is this the correct interpretation?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:black'>Thanks!<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;color:black'>Adam</span><o:p></o:p></p></div><div><div><p class=xxxxmsonormal><o:p> </o:p></p></div></div></div></body></html>