[Gdal-dev] How to split multi-layer geotiff images

Frank Warmerdam warmerdam at pobox.com
Fri Jun 16 19:07:35 EDT 2006


Clay, Bruce wrote:
>  I have had problems getting this message posted.  – the send keeps 
> timing out.  I apologize if multiples finally get sent out
> 
>  
> 
>  
> 
> Can GDAL be used to open multi-layer Geotiff raster files?
> 
>  
> 
> Not multi-band but more than one image in the same file. I was given 
> some Geotiff images that Microsoft Office Imaging tool shows 2 distinct 
> images in a single tiff file.
> 
>  
> 
> IDL was used to create the file using an APPEND function.
> 
>  
> 
> ArcMap does not seem to be able to find the second images so I would 
> like to extract the image using GDAL but I don’t see any info in the 
> documentation.
> 
>  
> 
> Tiffsplit in the FW tool set will split the file into 2 images but it 
> kicks up some error messages

Bruce,

I don't think GDAL provides a really convenient way of accessing these
multi-images; however, if you know how many directories there are you
can accessing them something like:

  gdal_translate GTIFF_DIR:2:2part.tif out.tif

So, prefix the filename with "GTIF_DIR:<number>:".  If <number> is
1 it will get the first directory, 2 for the second, etc.

You can see the dir count with tiffinfo or just try till it fails.

Ideally GDAL would report all the directories (that are no overviews)
as subdatasets but currently it does not.   I you would like to file
an enhancement bug in bugzilla I'll look into doing it at some point.

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