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

Gilles Bassière gbassiere at gmail.com
Tue Mar 23 11:08:58 EDT 2010


Jukka Rahkonen wrote:
> Gilles Bassière <gbassiere <at> gmail.com> writes:
> 
>> Hi,
>>
>> 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.
> ...
> 
>> 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)
> 
> I would perhaps calculate the extents I want the output tiles to have and run
> gdalwarp for each tile with -te option.
> 
> -Jukka Rahkonen-
> 

Hi Jukka,

Thanks for your suggestion. I've been able to get the extent
automatically computed by a little Bash scripting:

 for x in `seq -w 895 5 1020`; do
     for y in `seq -w 6290 5 6410`; do
         e="$((10#${x}*1000)) $((10#${y}*1000)) $(((10#${x}+5)*1000))
$(((10#${y}+5)*1000))"
         echo "=== Processing tile $x-$y ==="
         gdalwarp -s_srs "+init=epsg:27572" -t_srs "+init=epsg:2154" -te
$e -ts 10000 10000 ortho-dept04-2004-la2e.vrt
ortho-dept04-2004-lam93-tif/04-2004-$x-$y-lam93.tif
     done
 done

Regards

-- 
Gilles Bassière - Web/GIS software engineer
http://gbassiere.free.fr/


More information about the gdal-dev mailing list