[gdal-dev] Nitf Metadata parsing

Brad Hards bradh at frogmouth.net
Sun Apr 25 20:37:38 PDT 2021


I'm not sure what you mean by "objects" in this context. Do you mean methods and structures? 

It seems like you are referring to a lot of older mailing list threads. It is probably better to read the code.

For the DES case, you can see how GDAL does it through gdalinfo, with a command like:

./apps/gdalinfo -mdd xml:DES ~/20200723-RIP1B_BIP_Final_Released/07APR2005_Hyperion_331406N0442000E_SWIR172_001_L1R-01B-BIP-GLAS.ntf

Which produces:

Driver: NITF/National Imagery Transmission Format
Files: /home/bradh/20200723-RIP1B_BIP_Final_Released/07APR2005_Hyperion_331406N0442000E_SWIR172_001_L1R-01B-BIP-GLAS.ntf
Size is 64, 838
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
GeoTransform =
  44.41283704082986, 0.001278659611993035, -0.0002860746050710144
  33.69168768134494, -0.0002182539682539298, -0.001073775388291513
Metadata:
  NITF_ABPP=08
  NITF_CCS_COLUMN=0
  NITF_CCS_ROW=0
  NITF_CLEVEL=05
  NITF_ENCRYP=0
  NITF_FBKGC=  0,  0,  0
  NITF_FDT=20200723130601
  NITF_FHDR=NITF02.10
  NITF_FSCATP=
  NITF_FSCAUT=
  NITF_FSCLAS=U
  NITF_FSCLSY=
  NITF_FSCLTX=
  NITF_FSCODE=
  NITF_FSCOP=00000
  NITF_FSCPYS=00000
.....
  NITF_PVTYPE=INT
  NITF_STYPE=BF01
  NITF_TGTID=
Metadata (xml:DES):
<des_list>
  <des name="CSEPHB">
    <field name="NITF_DESVER" value="01" />
    <field name="NITF_DECLAS" value="U" />
    <field name="NITF_DESCLSY" value="" />
    <field name="NITF_DESCODE" value="" />
    <field name="NITF_DESCTLH" value="" />
    <field name="NITF_DESREL" value="" />
    <field name="NITF_DESDCTP" value="" />
    <field name="NITF_DESDCDT" value="" />
    <field name="NITF_DESDCXM" value="" />
    <field name="NITF_DESDG" value="" />
    <field name="NITF_DESDGDT" value="" />
    <field name="NITF_DESCLTX" value="" />
    <field name="NITF_DESCATP" value="" />
    <field name="NITF_DESCAUT" value="" />
    <field name="NITF_DESCRSN" value="" />
    <field name="NITF_DESSRDT" value="" />
    <field name="NITF_DESCTLN" value="" />
    <field name="NITF_DESSHL" value="0085" />
    <field name="NITF_DESSHF" value="cf306a0b-c47c-44fa-af63-463549f6bf98001002001824ecf8e-1041-4cce-9edb-bc92d88624ca0000" />
    <field name="NITF_DESDATA"
value="MTI1MDEwMDEuMDAwMDAwMDAwMjAwNTA0MDcwNzI0MDUuODg5MDAwMDAwMDAwMjQrMDQxNDg0NDQuMjUrMDQxODIwMDkuODQrMDM5MjM1NzMuODcrMDQxNTI1NTQuN
TMrMDQxODM3MTQuMzMrMDM5MTc0MjIuNjYrMDQxNTY2NjAuMzMrMDQxODU0MTMuNTErMDM5MTEyNjYuOTUrMDQxNjA3NjEuNzIrMDQxODcxMDcuNDkrMDM5MDUxMDYuOTMrM
DQxNjQ4NTguNzErMDQxODg3OTYuMTgrMDM4OTg5NDIuNDMrMDQxNjg5NTEuMjkrMDQxOTA0NzkuNTcrMDM4OTI3NzMuNjErMDQxNzMwMzkuNDgrMDQxOTIxNTcuNjYrMDM4O
DY2MDAuNDArMDQxNzcxMjMuMjcrMDQxOTM4MzAuNDQrMDM4ODA0MjIuNzgrMDQxODEyMDIuNTcrMDQxOTU0OTguMDIrMDM4NzQyNDAuODcrMDQxODUyNzcuNDYrMDQxOTcxN
jAuMzIrMDM4NjgwNTQuNDYrMDQxODkzNDcuOTUrMDQxOTg4MTcuMjErMDM4NjE4NjMuODMrMDQxOTM0MTMuOTUrMDQyMDA0NjguODkrMDM4NTU2NjguNzMrMDQxOTc0NzUuN
TQrMDQyMDIxMTUuMjgrMDM4NDk0NjkuMzArMDQyMDE1MzIuNjQrMDQyMDM3NTYuMzcrMDM4NDMyNjUuNTgrMDQyMDU1ODUuMzMrMDQyMDUzOTIuMTUrMDM4MzcwNTcuNTYrM
DQyMDk2MzMuNTMrMDQyMDcwMjIuNzMrMDM4MzA4NDUuMTQrMDQyMTM2NzcuMjIrMDQyMDg2NDcuOTMrMDM4MjQ2MjguNTErMDQyMTc3MTYuNTIrMDQyMTAyNjcuODErMDM4M
Tg0MDcuNTArMDQyMjE3NTEuMjIrMDQyMTE4ODIuNTArMDM4MTIxODIuMTgrMDQyMjU3ODEuNTErMDQyMTM0OTEuODArMDM4MDU5NTIuNTUrMDQyMjk4MDcuMzErMDQyMTUwO
TUuNzgrMDM3OTk3MTguNzIrMDQyMzM4MjguNjErMDQyMTY2OTQuNTYrMDM3OTM0ODAuNTErMDQyMzc4NDUuNDErMDQyMTgyODcuOTYrMDM3ODcyMzguMDcrMDQyNDE4NTcuN
zIrMDQyMTk4NzYuMDQrMDM3ODA5OTEuMzUwMDAwMDAwMDA=" />
  </des>
  <des name="CSCSDB">
....

Clearly you'll need to parse out the DESDATA part of the segment, using STDI-0002 as a guide.

Brad

-----Original Message-----
From: gdal-dev <gdal-dev-bounces at lists.osgeo.org> On Behalf Of jovajova24
Sent: Monday, 26 April 2021 3:53 AM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Nitf Metadata parsing

I found this,
http://osgeo-org.1560.x6.nabble.com/gdal-dev-NITF-DES-Data-td5448580.html ( and other threads) -- so it sounds like to parse a NITF
DES you need to rebuild GDAl with the ESRI_BUILD flag. Is this correct ?

Mover-over, I've been trying to find some c++ sample code to parse a NITF DES. 
Via this thread:
http://osgeo-org.1560.x6.nabble.com/gdal-dev-Accessing-a-Nitf-DES-td5485537.html

Even pointed me to this link:
https://github.com/OSGeo/gdal/pull/3153  ( and thank you for that) but these examples use objects like:
 NITFSegmentInfo
 NITFDESGetXml

Which when you download 3.2.1 for Windows, none of these specific NITF objects are included in the compilation.

Ok DUMB question (and I apologize for this) how do you get access to the listed above nitf specific objects? 

Is there a way to parse NITF DES data without using these objects?

So, now I'm trying to build GDAL myself and I run into the following issue: 

On VS 2019 it's complaining about the correct version of PROJ >= 6, even though I've set it to version 7.2. 

Can any one build the latest GDAL on windows outside the CI loop? 
If so can you post your setup?


Thanks again.

 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list