[GIS] Batch script converting and resampling orthophotos

convertgdalorthophotoraster

I would like to convert more than 300 orthophotos produced at scale 1:8.000 with a pixel size of 0.8m X 0.8m from Ecw format to Tiff format and after resampling pixel values.

My aim is to batch convert the input format (Ecw) to output format (Tiff) and after to resample the pixel size (values) 10mX10m.

How could I right this script using gdal to batch process this raster files.

I'm using FWTools on Windows XP

Thanks

Best Answer

You might want to consider using gdalwarp instead of gdal_translate as it gives you the ability to control the output pixel size more precisely.

eg.

gdalwarp -tr 10 10 src.ecw dst.tif

You can also specify a variety of resampling kernels. For such radical downsizing averaging might be appropriate.

eg.

for %i in (*.ecw) do gdalwarp -ps 10 10 -r average %i %~new_resize.tif