[gdal-dev] RE: Mosaic the output of gdal2tiles (iomeneandrei)

Stephen Mather mather.stephen at gmail.com
Tue Jan 4 00:46:34 EST 2011


>
> Hi all,
> I have a folder with a gdal2tiles output: 6 levels of zoom (and folders),
> with subfolders and  the .png tiles.
>
> Is there a gdal tool to merge in a single geotiff file these .png tiles?
>
>
Hi Andrea,
     Probably the simplest way to handle this is with a virtual dataset.
Rather than a direct mosaic, you create a virtual mosaic and then use
gdal_translate to convert to a geotiff, e.g.

1)
gdalbuildvrt test.vrt *.png

2)
gdal_translate test.vrt test.tif

Simple as that.  You'll want to perform this on your highest resolution
tile, I'm guessing.  It is good practice to provide overviews for
performance sake, so run gdaladdo:

3)
gdaladdo -r average test.tif  2 4 6 8 16 32 64 128

If you want to really optimize (and here others can probably make better
recommendations) you'll want to use internal tiling when you create the tif
(only applies to max resolution, but good to do nonetheless), e.g. replace
step two with:

2)
gdal_translate -co "TILED=YES" test.vrt test.tif

Steve Mather
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110104/4cb4db11/attachment.html


More information about the gdal-dev mailing list