[gdal-dev] JP2MRSID Issues

Stephen Woodbridge woodbri at swoodbridge.com
Mon Nov 10 11:52:28 EST 2008


Hello,

I posted this buried in another thread and thought it should be reposted 
in its own thread. A short history, I have a lot of USDA county 
composite DOQQs that have been assembled into JPEG2000 files that are 
about 500MB each. I am trying to chop these back into DOQQ GeoTiffs. I 
have a script that does the chopping, it just automates the process and 
issues commands to do the work.

I have abandon using the JPEG2000 driver and an now using the JP2MRSID 
driver. This is working better, but I'm still having problems like this:

I create a VRT file as follows for each jp2 file:

mkdir -p /home/swoodbridge/tiler-tiffs/30430-1226332146/src
gdal_translate -of VRT 
/var/data/raw_data/minnesota/ortho_1-1_1m_j_mn161_2008_1.jp2 -b 1 -b 2 
-b 3 /home/swoodbridge/tiler-tiffs/30430-1226332146/src/tmp.vrt

then the VRT file is iterated over to extract the tiles with commands like:

gdalwarp -srcnodata 0 -dstnodata 0 -s_srs +init=epsg:26915 -t_srs 
EPSG:4326 -te -93.5 43.8125 -93.4375 43.875 -rb -wm 250 --config 
GDAL_ONE_BIG_READ ON -co "TILED=YES" 
/home/swoodbridge/tiler-tiffs/30430-1226332146/src/tmp.vrt 
/home/swoodbridge/tiler-tiffs/30430-1226332146/B-93_43/B-93_43_041.tif

gdalwarp: ../compressed/compressed.cpp:1724: bool 
kd_tile::read_tile_part_header(): Assertion `tpart_body_length >= 0' failed.
Creating output file that is 6029P x 6029L.

This does not happen on all image tiles that I try to extract, but does 
happen on a significant number of them like nearly 50% in one case. I 
looked at the pattern of failures and it looks like failures happen 
within a row of the jp2, so extracted tiles are G=good, X=bad, .=empty

................
..GGGGGGGGG.....
..GGGGGGGGG.....
..GGGGGGGGG.....
..GXXXXXXXG.....
..GGGGGGGGG.....


..GXXXXXXXG.....
..GXXXXXXXG.....
..GXXXXXXXG.....
..GXXXXXXXG.....
...GXXXXXXXG....
................

Any thoughts on this?
Is there a way to verify its compression integrity?

I have try two different jp2 files of the 300+ friles that need to to be 
chopped up and gotten similar results.

Thanks,
   -Steve


More information about the gdal-dev mailing list