[gdal-dev] How to divide a raster layer into a set of tiles?

Gilles Bassière gbassiere at gmail.com
Mon Mar 22 14:35:47 EDT 2010


I'm trying to reproject an aerial imagery dataset with GDAL.

The initial dataset is composed of ECW tiles in EPSG:27572 and my goal
is to compute a new set set of ECW tiles projected in EPSG:2154.

The initial tileset is about 7.5GB. That's why I don't want to merge
everything into a single big ECW.

Reprojecting each individual tile separately is not an option since it
creates black pixels near tile edges (because of warping).

My current workflow consists in the following steps:
1) create a single GDAL layer from all initial tiles with gdalbuildvrt
2) reproject this virtual raster with gdalwarp (outputs a new .vrt)
3) divide this virtual raster into a new set of tile using gdal_retile.py

The problem with this workflow is that it creates non-georeferenced
tiles (I don't know if this is the intended behaviour of this command).

Hence my question, how do I cut up a raster layer into a set of
georeferenced tiles with GDAL?

Gilles Bassière - Web/GIS software engineer

More information about the gdal-dev mailing list