<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div class="moz-text-plain" style="font-family: -moz-fixed; font-size: 13px;" lang="x-unicode"><pre>Dear list,<br><br>I would like to tile a tiff-image (with tfw file) in 16 tiles.<br>I wonder if there is a possibility to avoid manual tiling for every tile like:
<br><br>gdal_translate –projwin 3429886 5799741 3435890 5794667<br>...path_to\landsat7.tiff path_to\landsat7_tile1.tiff<br><br>...this would be so much typing.  <br><br>Is there anywhere a possibility to tile the image with a script?
<br>Does the possibily exist to tile it automatically in the shell? <br></pre></div></blockquote><div>The tiling process is more simple when thinking in number of pixels instead of referenced coordinates.<br>Some kind of pseudo-code for exemple.
<br><br># xOff and yOff are the upper left pixel of tile not in referenced coordinates but in matrix coordinates.<br># nPixelsXImage and nPixelsYImage are the dimensions of the full image.<br># You can get them parsing the output of gdalinfo for exemple.
<br># xSize and ySize are the dimensions in number of pixels of the tiles.<br># You can compute them using nPixelsXImage and nPixelsYImage and the number of tiles you expect :<br>$xSize = $nPixelsXImage / $nTilesX<br>$ySize = $nPixelsYImage / $nTilesY
<br>for $xOff = 1 to $nPixelsXImage step $xSize<br>&nbsp; for $yOff = 1 to $nPixelsYImage step ySize<br>&nbsp;&nbsp;&nbsp; call gdal_translate -co &quot;TFW=YES&quot; -srcwin $xOff $yOff $xSize $ySize input.tif output_$xOff_$yOff.tif<br>&nbsp; end for $yOff
<br>end for $xOff<br><br>Note that the last line and the last raw of tiles might not have the expected $xSize $ySize.</div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
<div class="moz-text-plain" style="font-family: -moz-fixed; font-size: 13px;" lang="x-unicode"><pre>Another question: After tiling: Will for every tile a tfw-file be produced?</pre></div></blockquote><div><br>For this add&nbsp; the gdal_translate option -co&nbsp; &quot;TFW=YES&quot;. 
<br><br>I hope this will help you.<br><br>Regards,<br>Guillaume.<br></div><br>