[gdal-dev] gdal_merge.py outputs bad geotiff?

Even Rouault even.rouault at mines-paris.org
Fri Oct 24 14:21:22 EDT 2008


Andrew,

my guess is that your merged1.tif TIFF has areas which are not initialized 
(black/transparent areas). gdal_merge.py probably doesn't write any data in 
them, thus leading to missing blocks in the file. GDAL support them in 
reading, but those kind of tiff files are maybe not supported by PhotoshopCS3  
(they are known not to be widely supported by some readers)
But when you gdal_translate it, those missing blocks will be finally written 
as empty blocks (filled with zero). That accounts for the difference in size.

Le Friday 24 October 2008 18:46:26 Andrew Brooks, vous avez écrit :
> Hello
>
> When I use gdal_merge.py to merge two files and write a geotiff
> it creates a file which PhotoshopCS3 cannot read.  Yet the result
> of passing that tiff through gdal_translate produces a different
> tiff (of a completely different size) which *is* readable.
>
> % gdal_merge.py -v -o merged1.tif -of gtiff tl10dtm/w001001.adf
> tl67dtm/w001001.adf
>
> The Photoshop error is "Could not complete your request because of
> a problem parsing the TIFF file"
>
> % gdal_translate -of gtiff merged1.tif merged2.tif
> Input file size is 1200, 1600
> 0...10...20...30...40...50...60...70...80...90...100 - done.
>
> I don't understand the size of the first one given that there's
> no compression:
> % ls -l merged1.tif merged2.tif
>        981186 merged1.tif
>       3854344 merged2.tif
>
> However the tiffinfo output and the gdalinfo output are identical
> for both files (except for the TIFF directory offsets, see below.
>
> Andrew
>
>
> tiffinfo
> TIFF Directory at offset 0xee622 (976418)
>    Image Width: 1200 Image Length: 1600
>    Bits/Sample: 16
>    Sample Format: unsigned integer
>    Compression Scheme: None
>    Photometric Interpretation: min-is-black
>    Samples/Pixel: 1
>    Rows/Strip: 3
>    Planar Configuration: single image plane
>    Tag 33550: 50.000000,50.000000,0.000000
>    Tag 33922:
> 0.000000,0.000000,0.000000,510000.000000,280000.000000,0.000000 Tag 34735:
> 1,1,0,15,1024,0,1,1,1025,0,1,1,1026,34737,8,0,2048,0,1,4001,2049,34
> 737,49,8,2054,0,1,9102,3072,0,1,32767,3074,0,1,32767,3075,0,1,1,3076,0,1,90
>01,30
> 80,34736,1,1,3081,34736,1,0,3082,34736,1,3,3083,34736,1,4,3092,34736,1,2
> Tag 34736: 49.000000,-2.000000,0.999601,400000.000000,-100000.000000 Tag
> 34737: unnamed|Unknown datum based upon the Airy 1830 ellipsoid|
>
> gdalinfo
> Driver: GTiff/GeoTIFF
> Size is 1200, 1600
> Coordinate System is:
> PROJCS["unnamed",
>      GEOGCS["Unknown datum based upon the Airy 1830 ellipsoid",
>          DATUM["Not_specified_based_on_Airy_1830_ellipsoid",
>              SPHEROID["Airy 1830",6377563.396,299.3249646000043,
>                  AUTHORITY["EPSG","7001"]],
>              AUTHORITY["EPSG","6001"]],
>          PRIMEM["Greenwich",0],
>          UNIT["degree",0.0174532925199433],
>          AUTHORITY["EPSG","4001"]],
>      PROJECTION["Transverse_Mercator"],
>      PARAMETER["latitude_of_origin",49],
>      PARAMETER["central_meridian",-2],
>      PARAMETER["scale_factor",0.999601272],
>      PARAMETER["false_easting",400000],
>      PARAMETER["false_northing",-100000],
>      UNIT["metre",1,
>          AUTHORITY["EPSG","9001"]]]
> Origin = (510000.000000000000000,280000.000000000000000)
> Pixel Size = (50.000000000000000,-50.000000000000000)
> Metadata:
>    AREA_OR_POINT=Area
> Image Structure Metadata:
>    INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  (  510000.000,  280000.000) (  0d22'58.02"W, 52d24'23.61"N)
> Lower Left  (  510000.000,  200000.000) (  0d24'30.74"W, 51d41'15.02"N)
> Upper Right (  570000.000,  280000.000) (  0d29'54.91"E, 52d23'28.35"N)
> Lower Right (  570000.000,  200000.000) (  0d27'31.76"E, 51d40'21.17"N)
> Center      (  540000.000,  240000.000) (  0d 2'29.21"E, 52d 2'25.00"N)
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev




More information about the gdal-dev mailing list