mdaus / nitro

NITRO (NITFio, "R" is a ligature for "Fi") is a full-fledged, extensible library solution for reading and writing the National Imagery Transmission Format (NITF), a U.S. DoD standard format. It is written in cross-platform C, with bindings available for other languages.
GNU Lesser General Public License v3.0
62 stars 38 forks source link

`EXISTENCE_MASK` Field in BANDSB TRE Displays as 0 Despite Setting Values #611

Open samrat-boda opened 6 months ago

samrat-boda commented 6 months ago

I am experiencing an issue with the EXISTENCE_MASK field in the BANDSB TRE of a SNIP file, where the allocated field size appears to be insufficient.

Problems:

  1. Setting EXISTENCE_MASK Values Not Working: When attempting to set values for the EXISTENCE_MASK field in BANDSB TRE of SNIP files, the assigned values are not being recognized. Despite setting numerical values for EXISTENCE_MASK, it consistently displays as 0 when the TREs are printed.

  2. Insufficient Space for EXISTENCE_MASK in BANDSB TRE: The EXISTENCE_MASK field in the BANDSB TRE of SNIP files is allocated only 4 characters of space. This limitation poses a problem as it doesn't accommodate larger numerical values, causing potential data truncation or loss.

    "BANDSB": {
                    "COUNT": "3",
                    "RADIOMETRIC_QUANTITY": "RADIANCE",
                    "RADIOMETRIC_QUANTITY_UNIT": "S",
                    "SCALE_FACTOR": "80",
                    "ADDITIVE_FACTOR": "0",
                    "ROW_GSD": "0030.49",
                    "ROW_GSD_UNIT": "M",
                    "COL_GSD": "0029.96",
                    "COL_GSD_UNIT": "M",
                    "SPT_RESP_ROW": "-------",
                    "SPT_RESP_UNIT_ROW": "M",
                    "SPT_RESP_COL": "-------",
                    "SPT_RESP_UNIT_COL": "M",
                    "DATA_FLD_1": " ",
                    "EXISTENCE_MASK": "960",
                    "DATA_FLD_3[0]": "1",
                    "DATA_FLD_4[0]": "1",
                    "DATA_FLD_5[0]": "1",
                    "DATA_FLD_6[0]": "1",
                    "DATA_FLD_3[1]": "2",
                    "DATA_FLD_4[1]": "3",
                    "DATA_FLD_5[1]": "4",
                    "DATA_FLD_6[1]": "5",
                    "DATA_FLD_3[2]": "7",
                    "DATA_FLD_4[2]": "4",
                    "DATA_FLD_5[2]": "5",
                    "DATA_FLD_6[2]": "6"
                }
    --- Image [1] XHD TRE [BANDSB] - (122) ---
    COUNT(5) = '00003'
    RADIOMETRIC_QUANTITY(24) = 'RADIANCE                '
    RADIOMETRIC_QUANTITY_UNIT(1) = 'S'
    SCALE_FACTOR(4) = '0'
    ADDITIVE_FACTOR(4) = '0'
    ROW_GSD(7) = '0030.49'
    ROW_GSD_UNIT(1) = 'M'
    COL_GSD(7) = '0029.96'
    COL_GSD_UNIT(1) = 'M'
    SPT_RESP_ROW(7) = '-------'
    SPT_RESP_UNIT_ROW(1) = 'M'
    SPT_RESP_COL(7) = '-------'
    SPT_RESP_UNIT_COL(1) = 'M'
    DATA_FLD_1(48) = ''
    EXISTENCE_MASK(4) = '0'

    Questions:

  3. How can the issue of the EXISTENCE_MASK field displaying as 0 despite setting valid numerical values be addressed?

  4. Is there a method to extend the space allocated for the EXISTENCE_MASK field in the BANDSB TRE to support larger numerical values?