[Gdal-dev] tiff to jp2ecw

Frank Warmerdam warmerdam at pobox.com
Mon May 29 10:30:28 EDT 2006


Mark Overmeer wrote:
> Hi,
> 
> I am translating a geotiff into jpeg2000/ecw using gdal_translate in
> FWTools 1.0.0a7 linux (gdal 1.3.1)
> 
> The command I try is this:
> 
>    gdal_translate input.tif -of JP2ECW -ot Byte -co TARGET=0 output.jp2
> 
> However... there are two problems:
>  (1) the input.tif (geotiff) contains 6 images, created with
>        geotifcp [123456].tif input.tif
>      however, the resulting output.jp2 contains only one image (the first)

Mark,

Currently the GDAL GeoTIFF driver does not support using multiple
image directories except by special naming conventions on the input
file.  Basically GDAL treats GeoTIFF as a one-image-per-file format.

GDAL takes the same approach to JPEG2000 so even if you could read
the GeoTIFF as a multi-image file, you still couldn't write it to
JPEG2000 as a set of images.

Note that neither limitation is due to the format, just due to limitations
of the GDAL drivers.  These limitations are not specific to the FWTools
build.

If you wanted the six images treated as bands of a single image then
you could use a different mechanism to merge the bands. Let me know if
that was your desire.


>  (2) "gdalinfo output.jp2" says:
>        Driver: JP2KAK/JPEG-2000 (based on Kakadu)
>      where I expected JP2ECW

This is not a problem.  The result is a JPEG2000 file, and FWTools
includes more than one JPEG2000 driver, naming the JP2ECW driver, and
the JP2KAK driver.  Both can read JPEG2000 files but by default the
JP2KAK one is tried first.  For most use, it should be fine.  But if
for some reason you need to read the image back using the JP2ECW driver
you can ask GDAL to ignore the JP2KAK driver.  Something like:

  gdalinfo --config GDAL_SKIP JP2KAK output.jp2

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 OSGF, http://osgeo.org




More information about the Gdal-dev mailing list