[gdal-dev] NTF/JPEG2000 Question

Logan Greenlee lgreenlee at digitalresultsgroup.com
Sat Jul 16 23:49:39 EDT 2011


I'm not sure if this is the right venue - please direct me to another list.

I am having an issue processing DigitalGlobe NTF/JPEG2000 imagery with GDAL and MapServer.

I am currently using Version 1.8.1 MSVC2008 (Win64) -release with mapserver 6.0.1 found here:

http://www.gisinternals.com/sdk/

I also have an older GDAL version 1.6.0dev provided by an old install of FWTools.

I have found that there is a fairly significant difference between the two versions in the way that they handle NTF/JPEG2000 imagery from digital globe.

The issue that I am having is that 1.6.0 properly displays the four corner points of the image. Version 1.8.1 does not dispalay, and instead displays the GCP points. The GCP points look correct but the image does not render correctly using shp2img from map server. It uses the corrdinate system that is shown below which is pixel relative.

Here is the gdalinfo output from 1.8.1

>gdalinfo img_1.NTF
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_BAG.dll using GDALRegister_B
AG.
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_FITS.dll using GDALRegister_
FITS.
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_GMT.dll using GDALRegister_G
MT.
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_HDF5.dll using GDALRegister_
HDF5.
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_HDF5Image.dll using GDALRegi
ster_HDF5Image.
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_MrSID.dll using GDALRegister
_MrSID.
GDAL: Auto register C:\GDALMS\bin\gdal\plugins\gdal_netCDF.dll using GDALRegiste
r_netCDF.
GDAL: GDALOpen(/vsisubfile/3958_401263470,img_1.NTF, this=00000000037E0C40) succeeds as JP2OpenJPEG.
GDAL: NITFDataset::Open() wasn't able to derive a first order
geotransform.  It will be returned as GCPs.
GDAL: GDALOpen(img_1.NTF, this=0000000000C2C23
0) succeeds as NITF.
Driver: NITF/National Imagery Transmission Format
GDAL: GDALDefaultOverviews::OverviewScan()

... stuff ...

Resulting corner coordinates:

Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 7168.0)
Upper Right ( 9216.0,    0.0)
Lower Right ( 9216.0, 7168.0)
Center      ( 4608.0, 3584.0)
Band 1 Block=1024x1024 Type=UInt16, ColorInterp=Undefined
GDAL: GDALDefaultOverviews::OverviewScan()
Band 2 Block=1024x1024 Type=UInt16, ColorInterp=Blue
Band 3 Block=1024x1024 Type=UInt16, ColorInterp=Green
Band 4 Block=1024x1024 Type=UInt16, ColorInterp=Undefined
Band 5 Block=1024x1024 Type=UInt16, ColorInterp=Red
Band 6 Block=1024x1024 Type=UInt16, ColorInterp=Undefined
Band 7 Block=1024x1024 Type=UInt16, ColorInterp=Undefined
Band 8 Block=1024x1024 Type=UInt16, ColorInterp=Undefined


The GCP's appear correct.


>gdalinfo --version
GDAL 1.6.0dev, FWTools 2.2.8, released 2008/10/29

gdalinfo img_1.NTF
Warning 1: Image with 11 bits per sample will not be interpreted properly.
Driver: NITF/National Imagery Transmission Format
Files: img_1.NTF
Size is 9216, 7168
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 =
  -114.3414689117551, 2.117622234280029e-005, -1.937894360779166e-008
  33.34084229934283, 1.175619461023539e-006, -1.910763840441486e-005
Metadata:
  NITF_FHDR=NITF02.10

... stuff ....

Image Structure Metadata:
  COMPRESSION=JPEG2000
RPC Metadata:
  LINE_OFF=3425
  LINE_SCALE=3525
  SAMP_OFF=4412
  SAMP_SCALE=4450
  LONG_OFF=-114.2441
  LONG_SCALE=0.0979
  LAT_OFF=33.2772
  LAT_SCALE=0.0742
  HEIGHT_OFF=518
  HEIGHT_SCALE=500
  MIN_LONG=-114.29305
  MAX_LONG=-114.19515
  MIN_LAT=33.2401
  MAX_LAT=33.3143
Corner Coordinates:
Upper Left  (-114.3414689,  33.3408423) (114d20'29.29"W, 33d20'27.03"N)
Lower Left  (-114.3416078,  33.2038787) (114d20'29.79"W, 33d12'13.96"N)
Upper Right (-114.1463088,  33.3516768) (114d 8'46.71"W, 33d21'6.04"N)
Lower Right (-114.1464478,  33.2147133) (114d 8'47.21"W, 33d12'52.97"N)
Center      (-114.2439583,  33.2777778) (114d14'38.25"W, 33d16'40.00"N)
Band 1 Block=9216x1 Type=UInt16, ColorInterp=Undefined
  Overviews: arbitrary
Band 2 Block=9216x1 Type=UInt16, ColorInterp=Blue
  Overviews: arbitrary
Band 3 Block=9216x1 Type=UInt16, ColorInterp=Green
  Overviews: arbitrary
Band 4 Block=9216x1 Type=UInt16, ColorInterp=Undefined
  Overviews: arbitrary
Band 5 Block=9216x1 Type=UInt16, ColorInterp=Red
  Overviews: arbitrary
Band 6 Block=9216x1 Type=UInt16, ColorInterp=Undefined
  Overviews: arbitrary
Band 7 Block=9216x1 Type=UInt16, ColorInterp=Undefined
  Overviews: arbitrary
Band 8 Block=9216x1 Type=UInt16, ColorInterp=Undefined
  Overviews: arbitrary

Any help would be appreciated!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110716/9184a5ea/attachment.html


More information about the gdal-dev mailing list