[Gdal-dev] image tile question

Frank Warmerdam warmerdam at pobox.com
Thu Mar 16 00:18:14 EST 2006


Haobo Yu wrote:
> Hi,
> 
> I'm new to this list, please pardon my ignorance.
> 
> I have several image files (in GeoTIFF) about 10000x10000 pixels each,
> and I'd like to serve it through MapServer.  Because of its size, I'm
> thinking that it might help if I cut it to smaller tiles.  While
> searching in this list's archive, I found that the main relevant theme
> was to build a tiled GeoTIFF file to break long scanlines, but I didn't
> find discussion about how to cut a big GeoTIFF to smaller pieces while
> providing correct georeference information to each smaller file.  If I
> understand it correctly: without correct georeference, gdaltindex will
> not work.
> 
> My questions are:
> 
> (1) Should I be concerned about cutting a GeoTIFF file to smaller
> pieces?  I can think of reasons that finding image blocks inside a TIFF
> can be faster than finding one image in a directory of 3000 files.  But
> in reality, is a big tiled GeoTIFF file good enough to be served through
> a MapServer?  

Haobo,

My general advice would be to use internal GeoTIFF tiling, and build
overviews.  For example:

gdal_translate -co TILED=YES old.tif new_tiled.tif
gdaladdo new_tiled.tif 2 4 8 16 32 64 128

This format should work quite efficiently with MapServer in many
use patterns, and is easy to manage.  Luckily 10K x 10K especially large
though it is substantial.

> (2) If I need to create smaller tile images, is there a good tool/script
> to cut a large GeoTIFF file?  I don't mind writing one, but didn't want
> to reinvent the wheel, either.

I'm not aware of a script, but you can use the gdal_translate to cut
out a chunk of an image, assigning appropriate georeferencing.

For instance:

gdal_translate -srcwin 0 0 2000 2000 in.tif out_0_0.tif
gdal_translate -srcwin 2000 0 2000 2000 in.tif out_1_0.tif
...

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