[Gdal-dev] gdal_translate problem with NITF RGBA image

John Bowen jbowen at BlackbirdTech.com
Thu May 17 10:35:18 EDT 2007


Thanks for the quick response!  I've been displaying the images using
GeoRect, which is part of the distro from FalconView.

Here is the output from gdalinfo on the input file:

Driver: NITF/National Imagery Transmission Format
Size is 6876, 2187
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
GeoTransform =
  -77.14709969696965, 3.272727272726178e-005, -3.454782636896493e-017
  38.8590402679309, -1.090909090907574e-006, -2.388939717393872e-005
Metadata:
  NITF_FHDR=NITF02.00
  NITF_CLEVEL=06
  NITF_STYPE=
  NITF_OSTAID=DG
  NITF_FDT=16011310ZDEC06
  NITF_FTITLE=QB02_SENSOR:2006-12-09T16:13:03.439710Z
  NITF_FSCLAS=U
  NITF_FSCODE=
  NITF_FSCTLH=
  NITF_FSREL=
  NITF_FSCAUT=
  NITF_USE00A_ANGLE_TO_NORTH=270
  NITF_USE00A_MEAN_GSD=108.2
  NITF_USE00A_DYNAMIC_RANGE=02047
  NITF_USE00A_OBL_ANG=21.47
  NITF_STDIDC_ACQUISITION_DATE=20061209161303
  NITF_STDIDC_MISSION=QB02
  NITF_STDIDC_PASS=12
  NITF_STDIDC_OP_NUM=000
  NITF_STDIDC_START_SEGMENT=AA
  NITF_STDIDC_REPRO_NUM=00
  NITF_STDIDC_REPLAY_REGEN=000
  NITF_STDIDC_START_COLUMN=001
  NITF_STDIDC_START_ROW=00001
  NITF_STDIDC_END_SEGMENT=AA
  NITF_STDIDC_END_COLUMN=007
  NITF_STDIDC_END_ROW=00003
  NITF_STDIDC_COUNTRY=
  NITF_STDIDC_WAC=
  NITF_STDIDC_LOCATION=3851N07702W
  NITF_USE00A_ROLL_ANG=-20.36
  NITF_USE00A_N_REF=00
  NITF_USE00A_REV_NUM=28897
  NITF_USE00A_N_SEG=001
  NITF_USE00A_MAX_LP_SEG=002187
  NITF_USE00A_SUN_EL=+27.5
  NITF_USE00A_SUN_AZ=167.7
  NITF_FSCTLN=
  NITF_FSDWNG=
  NITF_FSCOP=00000
  NITF_FSCPYS=00000
  NITF_ENCRYP=0
  NITF_ONAME=~~~DigitalGlobe
  NITF_OPHONE=+1(800)496-1225
  NITF_IID1=055E0F00
  NITF_IDATIM=09161303ZDEC06
  NITF_TGTID=
  NITF_ITITLE=09DEC06QB021200006DEC09161303-M1BS-005590231010_01_P002
  NITF_ISCLAS=U
  NITF_ISCODE=
  NITF_ISCTLH=
  NITF_ISREL=
  NITF_ISCAUT=
  NITF_ISCTLN=
  NITF_ISDWNG=
  NITF_ISORCE=QB02
  NITF_PVTYPE=INT
  NITF_IREP=MULTI
  NITF_ICAT=MS
  NITF_ABPP=11
  NITF_PJUST=R
  NITF_IMAGE_COMMENTS=The imagery and metadata data on this media is the
property of                  DigitalGlobe and is licensed for use only.
All use must be in                   accordance with the terms of the
license that accompanies the media.            If the license is
purchased under contract NMA 301 99 D003, use is              in
accordance with the license therein

  NITF_IC=NC
  NITF_IMODE=S
  RPC_LINE_OFF=1094
  RPC_LINE_SCALE=1113
  RPC_SAMP_OFF=3434
  RPC_SAMP_SCALE=3511
  RPC_LONG_OFF=-77.0348
  RPC_LONG_SCALE=0.1127
  RPC_LAT_OFF=38.829
  RPC_LAT_SCALE=0.03
  RPC_HEIGHT_OFF=22
  RPC_HEIGHT_SCALE=501
  RPC_LINE_NUM_COEFF=0.00923356 -0.1426047 -1.126595 -0.01755206
0.00177297 6.701793e-005 0.0001558003 -0.001477191 -0.00521764
6.540608e-006 8.864884e-007 1.928861e-006 2.245907e-005 2.061583e-007
-1.944235e-005 -3.460201e-005 1.666924e-006 2.18262e-008 9.625121e-006
5.373261000000001e-007 
  RPC_LINE_DEN_COEFF=1 0.003106796 0.004811952 0.0003586957
5.199614e-006 4.229715e-008 3.307354e-006 -6.042672e-006 1.515212e-005
3.024721e-006 -7.842597e-006 -1.489278e-007 -5.154156e-005
-1.342397e-006 -7.041556e-006 -0.0001321335 -1.043995e-005
-4.647267e-007 -2.992527e-005 -1.26809e-006 
  RPC_SAMP_NUM_COEFF=-0.007781954 0.9804324 0.0001611866 -0.02055254
-0.0007931527 0.0003408651 -0.0001054206 0.007721833
9.428942999999999e-005 -1.056684e-005 -1.835947e-006 5.108406e-005
3.110137e-006 -2.600045e-006 1.76368e-005 5.887504e-005 -1.361459e-006
6.903016e-006 -1.013644e-006 -4.142256e-008 
  RPC_SAMP_DEN_COEFF=1 6.572976999999999e-005 0.0007770264 -0.0004941248
-1.076262e-005 -4.14945e-006 4.664055e-007 3.926331e-006
-7.662800000000001e-006 -2.77191e-006 1.522162e-008 -3.491444e-007
2.100755e-007 1.394239e-008 -1.637887e-007 1.138227e-006 -1.141229e-008
-9.558018e-008 2.025416e-008 0 
  RPC_MIN_LONG=-77.09115
  RPC_MAX_LONG=-76.97845000000001
  RPC_MIN_LAT=38.814
  RPC_MAX_LAT=38.844
Corner Coordinates:
Upper Left  ( -77.1470997,  38.8590403) ( 77d 8'49.56"W, 38d51'32.54"N)
Lower Left  ( -77.1470997,  38.8067942) ( 77d 8'49.56"W, 38d48'24.46"N)
Upper Right ( -76.9220670,  38.8515392) ( 76d55'19.44"W, 38d51'5.54"N)
Lower Right ( -76.9220670,  38.7992931) ( 76d55'19.44"W, 38d47'57.46"N)
Center      ( -77.0345833,  38.8291667) ( 77d 2'4.50"W, 38d49'45.00"N)
Band 1 Block=1024x1024 Type=UInt16, ColorInterp=Blue
Band 2 Block=1024x1024 Type=UInt16, ColorInterp=Green
Band 3 Block=1024x1024 Type=UInt16, ColorInterp=Red
Band 4 Block=1024x1024 Type=UInt16, ColorInterp=Undefined

And here is the output from nitfdump:

Dump for 06DEC09161303-M1BS-005590231010_01_P002.NTF
File Metadata:
  NITF_FHDR=NITF02.00
  NITF_CLEVEL=06
  NITF_STYPE=
  NITF_OSTAID=DG
  NITF_FDT=16011310ZDEC06
  NITF_FTITLE=QB02_SENSOR:2006-12-09T16:13:03.439710Z
  NITF_FSCLAS=U
  NITF_FSCODE=
  NITF_FSCTLH=
  NITF_FSREL=
  NITF_FSCAUT=
  NITF_FSCTLN=
  NITF_FSDWNG=
  NITF_FSCOP=00000
  NITF_FSCPYS=00000
  NITF_ENCRYP=0
  NITF_ONAME=~~~DigitalGlobe
  NITF_OPHONE=+1(800)496-1225
Segment 1 (Type=IM):
  HeaderStart=413, HeaderSize=2584, DataStart=2997, DataSize=176160768

Segment 2 (Type=TX):
  HeaderStart=176163765, HeaderSize=282, DataStart=176164047,
DataSize=3447

Image Segment 0, 6876Px2187Lx4B x 16bits:
  PVTYPE=INT, IREP=MULTI, ICAT=MS, IMODE=S, IC=NC, COMRAT=, ICORDS=G
  UL=(-77.1471,38.859), UR=(-76.9221,38.8515)
  LL=(-77.1471,38.8068), LR=(-76.9221,38.7993)
  7 x 3 blocks of size 1024 x 1024
  Image TREs: PIAIMC(362) RPC00B(1041) STDIDC(89) USE00A(107)
  Comments:
The imagery and metadata data on this media is the property of
DigitalGlobe and is licensed for use only. All use must be in
accordance with the terms of the license that accompanies the media.
If the license is purchased under contract NMA 301 99 D003, use is
in accordance with the license therein

  Band 1: IREPBAND=B, ISUBCAT=479.5, 0 LUT entries.
  Band 2: IREPBAND=G, ISUBCAT=546.5, 0 LUT entries.
  Band 3: IREPBAND=R, ISUBCAT=654, 0 LUT entries.
  Band 4: IREPBAND=N, ISUBCAT=814.5, 0 LUT entries.
  RPC00B:
    SUCCESS=1
    ERR_BIAS=18.44
    ERR_RAND=0.55
    LINE_OFF=1094
    SAMP_OFF=3434
    LAT_OFF =38.829
    LONG_OFF=-77.0348
    HEIGHT_OFF=22
    LINE_SCALE=1113
    SAMP_SCALE=3511
    LAT_SCALE =0.03
    LONG_SCALE=0.1127
    HEIGHT_SCALE=501
    LINE_NUM_COEFF = 0.00923356 -0.1426047 -1.126595 -0.01755206
0.00177297 
                     6.701793e-005 0.0001558003 -0.001477191 -0.00521764
6.540608e-006 
                     8.864884e-007 1.928861e-006 2.245907e-005
2.061583e-007 -1.944235e-005 
                     -3.460201e-005 1.666924e-006 2.18262e-008
9.625121e-006 5.373261e-007 
    LINE_DEN_COEFF = 1 0.003106796 0.004811952 0.0003586957
5.199614e-006 
                     4.229715e-008 3.307354e-006 -6.042672e-006
1.515212e-005 3.024721e-006 
                     -7.842597e-006 -1.489278e-007 -5.154156e-005
-1.342397e-006 -7.041556e-006 
                     -0.0001321335 -1.043995e-005 -4.647267e-007
-2.992527e-005 -1.26809e-006 
    SAMP_NUM_COEFF = -0.007781954 0.9804324 0.0001611866 -0.02055254
-0.0007931527 
                     0.0003408651 -0.0001054206 0.007721833
9.428943e-005 -1.056684e-005 
                     -1.835947e-006 5.108406e-005 3.110137e-006
-2.600045e-006 1.76368e-005 
                     5.887504e-005 -1.361459e-006 6.903016e-006
-1.013644e-006 -4.142256e-008 
    SAMP_DEN_COEFF = 1 6.572977e-005 0.0007770264 -0.0004941248
-1.076262e-005 
                     -4.14945e-006 4.664055e-007 3.926331e-006
-7.6628e-006 -2.77191e-006 
                     1.522162e-008 -3.491444e-007 2.100755e-007
1.394239e-008 -1.637887e-007 
                     1.138227e-006 -1.141229e-008 -9.558018e-008
2.025416e-008 0 
    RPC Transform (-77.147099697,38.8590402679,0) ->
(13.0582,-0.0331189)
    RPC Transform (-76.9220669697,38.851539177,0) -> (6876.8,8.03432)
    RPC Transform (-77.147099697,38.8067941563,0) -> (1.97586,2195.33)
    RPC Transform (-76.9220669697,38.7992930654,0) -> (6884.99,2180.54)
    RPC Transform (-77.0345833333,38.8291666667,0) -> (3416.47,1097.86)
    RPC Transform (-77.0345833333,38.8291666667,300) ->
(3373.23,1086.17)
  USE00A TRE:
    NITF_USE00A_ANGLE_TO_NORTH=270
    NITF_USE00A_MEAN_GSD=108.2
    NITF_USE00A_DYNAMIC_RANGE=02047
    NITF_USE00A_OBL_ANG=21.47
    NITF_USE00A_ROLL_ANG=-20.36
    NITF_USE00A_N_REF=00
    NITF_USE00A_REV_NUM=28897
    NITF_USE00A_N_SEG=001
    NITF_USE00A_MAX_LP_SEG=002187
    NITF_USE00A_SUN_EL=+27.5
    NITF_USE00A_SUN_AZ=167.7
  STDIDC TRE:
    NITF_STDIDC_ACQUISITION_DATE=20061209161303
    NITF_STDIDC_MISSION=QB02
    NITF_STDIDC_PASS=12
    NITF_STDIDC_OP_NUM=000
    NITF_STDIDC_START_SEGMENT=AA
    NITF_STDIDC_REPRO_NUM=00
    NITF_STDIDC_REPLAY_REGEN=000
    NITF_STDIDC_START_COLUMN=001
    NITF_STDIDC_START_ROW=00001
    NITF_STDIDC_END_SEGMENT=AA
    NITF_STDIDC_END_COLUMN=007
    NITF_STDIDC_END_ROW=00003
    NITF_STDIDC_COUNTRY=
    NITF_STDIDC_WAC=
    NITF_STDIDC_LOCATION=3851N07702W
  Image Metadata:
    NITF_IID1=055E0F00
    NITF_IDATIM=09161303ZDEC06
    NITF_TGTID=
    NITF_ITITLE=09DEC06QB021200006DEC09161303-M1BS-005590231010_01_P002
    NITF_ISCLAS=U
    NITF_ISCODE=
    NITF_ISCTLH=
    NITF_ISREL=
    NITF_ISCAUT=
    NITF_ISCTLN=
    NITF_ISDWNG=
    NITF_ISORCE=QB02
    NITF_PVTYPE=INT
    NITF_IREP=MULTI
    NITF_ICAT=MS
    NITF_ABPP=11
    NITF_PJUST=R

Thanks again!
John


-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Thursday, May 17, 2007 11:38 AM
To: John Bowen
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] gdal_translate problem with NITF RGBA image

John Bowen wrote:
> I'm trying to convert a 16bpp, 4 band NITF image into a GeoTiff and
have 
> not been able to figure out the arguments necessary to properly
convert 
> it.  Accompanying the NITF image is a text description of the image, 
> which contains (parts edited out with <snip> and </snip> for brevity:

John,

It is not obvious to me why this wouldn't have worked.  Could you supply
a gdalinfo report for the input file?  What were you using to view the
resulting TIFF files?

Actually, I'd suggest adding -co INTERLEAVE=PIXEL to your gdal_translate
command on the chance your tiff viewer does not support "SEPARATE"
organized
TIFF files.

If the problem turns out to be the nitf reading, another step is to run
the nitfdump utility against the nitf file for more details info.  This
utility can be manually built by cd'ing into the gdal/frmts/nitf
directory
in the source tree and doing "nmake /f makefile.vc nitfdump.exe" or
"make nitfdump" depending on platform.

Best regards,
-- 
---------------------------------------+--------------------------------
------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo,
http://osgeo.org





More information about the Gdal-dev mailing list