Opened 22 years ago

Last modified 22 years ago

#134 closed defect (wontfix)

SAR_CEOS -> GTiff produces non-standard (broken?) tiff

Reported by: alessandro_amici@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:



system is linux (debian woody) with gdal 1.1.7 and libtiff 3.5.5.

i need to convert a SAR_CEOS file to GTiff format.

amici@pc5-b:~$ gdalinfo /cdrom/SCENE1/DAT_01.001
Size is 4900, 26529
.... <snip>
Band 1 Block=4900x1 Type=CInt16, ColorInterp=Undefined

NOTE: one band, complex type.


amici@pc5-b:~$ gdal_translate -of GTiff /cdrom/SCENE1/DAT_01.001 roma.tif

i get an output tif file that appears to be read normally by gdalinfo

amici@pc5-b:~/tmp/ceos$ gdalinfo roma.tif
Driver: GTiff/GeoTIFF
Size is 4900, 26529
... <snip>
Band 1 Block=4900x1 Type=CInt16, ColorInterp=Gray

again one band with complex type, even if AFAIK tiff doesn't
support complex types!
indeed tiffinfo (3.5.5) fails with the following error:

amici@pc5-b:~$ tiffinfo roma.tif
roma.tif: Warning, unknown field with tag 33922 (0x8482) ignored.
roma.tif: Warning, unknown field with tag 34735 (0x87af) ignored.
roma.tif: 5: Bad value for "SampleFormat".

which sounds reasonamble since only values 1 to 4 are defined in the
tiff specs.

using -ot CFloat32 doesn't help eather.

since complex types are a problem for tiff (and for many other formats as well)
it would be nice to have an option for splitting them into two real bands.
best if BIP or selectable. is it feasible? is it hard to implement? can the
help of a tiff newbie be useful?


Change History (1)

comment:1 by warmerdam, 22 years ago


The data in the CEOS file is complex.  I have added a complex type as an
extension to TIFF format (also supported in the generally used libtiff).  
While it is true that this file does not match the TIFF standard, it isn't
my intention to change it. 

Note that you can use a command like the following to just take the
real component of the source file.  I am afraid there is not easy way to
get the magnitude of the complex image ... you could use Numpy to accomplish
this though.

gdal_translate -ot Int16 in.img out.tif

Note: See TracTickets for help on using tickets.