[gdal-dev] Reading JPEG2000 file related to drivers

Yves Jacolin yjacolin at free.fr
Tue Oct 13 01:56:42 PDT 2015


Hello,

Sorry for the long mail. I test jpg2 reading with GDAL for a small piece of 
file (12M).

# first test :

$ gdalinfo --version
GDAL 1.10.1, released 2013/08/26

$ gdalinfo file.jp2
Driver: JPEG2000/JPEG-2000 part 1 (ISO/IEC 15444-1)                                                                                                                                                                                                                            
Files: UnKiloDeJP2000-Ratio25-Pixel-10cm.jp2                                                                                                                                                                                                                                   
       UnKiloDeJP2000-Ratio25-Pixel-10cm.j2w                                                                                                                                                                                                                                   
Size is 10000, 10000                                                                                                                                                                                                                                                           
Coordinate System is:                                                                                                                                                                                                                                                          
LOCAL_CS["This file was created with the ECW JPEG 2000 SDK build 3.3.0.160 
copyright 1998-2005 by ER Mapper.  This GeoJP2 header was translated from the 
following ER Mapper style registration information:                                                                   
        fOriginX:                       1840000.000000                                                                                                                                                                                                                         
        fOriginY:                       5178000.000000                                                                                                                                                                                                                         
        fCellIncrementX:                0.100000                                                                                                                                                                                                                               
        fCellIncrementY",                                                                                                                                                                                                                                                      
    UNIT["unknown",1]]                                                                                                                                                                                                                                                         
Origin = (1840000.000000000000000,5178000.000000000000000)                                                                                                                                                                                                                     
Pixel Size = (0.100000000000000,-0.100000000000000)                                                                                                                                                                                                                            
Corner Coordinates:                                                                                                                                                                                                                                                            
Upper Left  ( 1840000.000, 5178000.000) 
Lower Left  ( 1840000.000, 5177000.000) 
Upper Right ( 1841000.000, 5178000.000) 
Lower Right ( 1841000.000, 5177000.000) 
Center      ( 1840500.000, 5177500.000) 
[Here it hangs and Swap then crash]

ok, let's add 4 Go of RAM (*2 from the first test)) : I get 8 Go RAM full + 
~3.5 swap but I get now all the metadata.

# second test
$ gdalinfo --version
GDAL 2.1.0dev, released 2015/99/99

$ gdalinfo file.jp2
Driver: JP2ECW/ERDAS JPEG2000 (SDK 5.2)
Files: 
/home/yjacolin/Documents/Projets/grandlyon_geosupport/01_working_papers/migration_jessie/Ortho_jpg2/UnKiloDeJP2000-
Ratio25-Pixel-10cm.jp2
Size is 10000, 10000
Coordinate System is:
LOCAL_CS["This file was created with the ECW JPEG 2000 SDK build 3.3.0.160 
copyright 1998-2005 by ER Mapper.  This GeoJP2 header was translated from the 
following ER Mapper style registration information:
        fOriginX:                       1840000.000000
        fOriginY:                       5178000.000000
        fCellIncrementX:                0.100000
        fCellIncrementY",
    UNIT["unknown",1]]
Origin = (1840000.000000000000000,5178000.000000000000000)
Pixel Size = (0.100000000000000,-0.100000000000000)
Metadata:
  ALL_COMMENTS=ECW JPEG 2000 SDK v3.3.0.160
  COLORSPACE=RGB
  COMPRESSION_RATE_TARGET=33
Corner Coordinates:
Upper Left  ( 1840000.000, 5178000.000) 
Lower Left  ( 1840000.000, 5177000.000) 
Upper Right ( 1841000.000, 5178000.000) 
Lower Right ( 1841000.000, 5177000.000) 
Center      ( 1840500.000, 5177500.000) 
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Description = Red
  Overviews: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 156x156
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 
156x156
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Description = Green
  Overviews: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 156x156
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 
156x156
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Description = Blue
  Overviews: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 156x156
  Mask Flags: PER_DATASET ALPHA 
  Overviews of mask band: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 
156x156
Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha
  Description = AllOpacity
  Overviews: 5000x5000, 2500x2500, 1250x1250, 625x625, 312x312, 156x156

No hang, no swap, no ram used

# Questions :)

* is it possible to choose the driver used by gdal? For instance, in my second 
test, my gdal install have two driver; ECW SDK and OpenJpeg. Currently, I am 
building several gdal instance to test each driver :/
* the difference between the two test, is it a problem from the driver used of 
from gdal release?

Thanks,

Y.


More information about the gdal-dev mailing list