[gdal-dev] RE: GDAL JPEG2000 Problems

Bob Bruce Bob.Bruce at pobox.com
Thu Jun 19 10:14:02 EDT 2008


I recently decided to try to use the JPEG2000 image types for the
distribution of orthophotography as an open source alternative to MrSID. I
hadn't had any experience with this image type before so I've been learning
and trying to make it work. I have had poor success so I thought that I'd
try and look for help here.

I was having some problems with output JP2 images from GDAL and noticed that
my version of FWTools was a bit old so today I downloaded and installed the
latest version of FWTools. Immediately I noticed that the only JPEG2000
output format left is the ECW one. What happened to the Kakadu and the
JasPer formats that were previously in GDAL? I understand that ECW has a
conversion limit and this will be a concern for me as I try and make mosaics
of blocks of photography.

So I went on to use the ECW JPEG2000 and ran into problems. I converted one
of our 73Mb colour orthophotos (GeoTiff - we have 744 of them from our
latest contract) to ECW JP2 and immediately noticed problems. In the output
ECWJP2 file the entire 135m bottom of the image was replaced by bands of
data 255m wide X 135m high that was taken 135m from the right side and 135
up from the bottom. The entire right 135m of the image is replaced with a
band taken starting 2X135m from the right and a further 135m to the right.
The original GeoTiff appeared fine when viewed in QGIS, gvSIG and some
proprietary GIS packages. QGIS showed these bands of data along the bottom
and along the right side of the image.

I am using version: GDAL 1.6.0dev, FWTools 2.2.1, released 2008/06/17 of the
software.

Does anyone know what I could be doing wrong in converting this image?

thanks,
		Bob Bruce

Here is info about the original geotiff image and the output JPEG2000ECW
image:

C:\CARIS\data\MapconSampleOrthos\JPEG2000Test>dir
 Volume in drive C has no label.
 Volume Serial Number is ACDA-7596

 Directory of C:\CARIS\data\MapconSampleOrthos\JPEG2000Test

18/06/2008  05:05 PM    <DIR>          .
18/06/2008  05:05 PM    <DIR>          ..
21/05/2008  06:38 PM        75,040,806 4305610.tif

C:\CARIS\data\MapconSampleOrthos\JPEG2000Test>gdal_translate -of JP2ECW
4305610.tif 4305610ECW.jp2
Warning 1: TIFFReadDirectory:Unknown field with tag 33918 (0x847e)
encountered
Warning 1: TIFFFetchNormalTag:ASCII value for tag "GeoASCIIParams" does not
end in null byte
Input file size is 5000, 5000
0...10...20...30...40...50...60...70...80...90...100 - done.

C:\CARIS\data\MapconSampleOrthos\JPEG2000Test>dir
 Volume in drive C has no label.
 Volume Serial Number is ACDA-7596

 Directory of C:\CARIS\data\MapconSampleOrthos\JPEG2000Test

18/06/2008  05:40 PM    <DIR>          .
18/06/2008  05:40 PM    <DIR>          ..
21/05/2008  06:38 PM        75,040,806 4305610.tif
18/06/2008  05:40 PM        16,487,327 4305610ECW.jp2
18/06/2008  05:40 PM               240 4305610ECW.jp2.aux.xml

C:\CARIS\data\MapconSampleOrthos\JPEG2000Test>gdalinfo 4305610.tif
Warning 1: TIFFReadDirectory:Unknown field with tag 33918 (0x847e)
encountered
Warning 1: TIFFFetchNormalTag:ASCII value for tag "GeoASCIIParams" does not
end in null byte
Driver: GTiff/GeoTIFF
Files: 4305610.tif
Size is 5000, 5000
Coordinate System is:
PROJCS["NAD83 / UTM zone 14N",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-99],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26914"]]
Origin = (430000.000000000000000,5615000.000000000000000)
Pixel Size = (0.999999999941792,-0.999999999068677)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  430000.000, 5615000.000) ( 99d59'27.05"W, 50d40'57.42"N)
Lower Left  (  430000.000, 5610000.000) ( 99d59'23.65"W, 50d38'15.57"N)
Upper Right (  435000.000, 5615000.000) ( 99d55'12.30"W, 50d40'59.51"N)
Lower Right (  435000.000, 5610000.000) ( 99d55'9.14"W, 50d38'17.66"N)
Center      (  432500.000, 5612500.000) ( 99d57'18.04"W, 50d39'37.56"N)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue

C:\CARIS\data\MapconSampleOrthos\JPEG2000Test>gdalinfo 4305610ECW.jp2
Driver: JP2ECW/ERMapper JPEG2000
Files: 4305610ECW.jp2
       4305610ECW.jp2.aux.xml
Size is 5000, 5000
Coordinate System is:
PROJCS["NAD83 / UTM zone 14N",
    GEOGCS["NAD83",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS 1980",6378137,298.2572221010002,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6269"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4269"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-99],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","26914"]]
Origin = (430000.000000000000000,5615000.000000000000000)
Pixel Size = (0.999999999941792,-0.999999999068677)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  (  430000.000, 5615000.000) ( 99d59'27.05"W, 50d40'57.42"N)
Lower Left  (  430000.000, 5610000.000) ( 99d59'23.65"W, 50d38'15.57"N)
Upper Right (  435000.000, 5615000.000) ( 99d55'12.30"W, 50d40'59.51"N)
Lower Right (  435000.000, 5610000.000) ( 99d55'9.14"W, 50d38'17.66"N)
Center      (  432500.000, 5612500.000) ( 99d57'18.04"W, 50d39'37.56"N)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
  Overviews: arbitrary
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
  Overviews: arbitrary
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
  Overviews: arbitrary



More information about the gdal-dev mailing list