| 1 | I often need to convert a set of rasters from a format to another format.[[BR]] |
| 2 | To do this is very useful a really simple batch procedure using the features of dos shell scripting language.[[BR]] |
| 3 | |
| 4 | ---- |
| 5 | '''Convert from a set of Geotiff to a set of TIF+TFW removing the GeoTiff tags'''[[BR]] |
| 6 | [[BR]] |
| 7 | |
| 8 | The source_folder is the folder where (include subfolders) there is the source TIF. The target_folder is the destination for raster outputs.[[BR]] |
| 9 | Also EPSG:3003 is the source SRS and also EPSG:3003 is the target SRS.[[BR]] |
| 10 | [[BR]] |
| 11 | The option PROFILE=BASELINE remove the geotiff tags, the TFW=YES ask to create the TFW file.[[BR]] |
| 12 | |
| 13 | {{{ |
| 14 | for /R F:/folder1/source_folder %f IN (*.tif) do gdalwarp.exe -co PROFILE=BASELINE -co TFW=YES -s_srs EPSG:3003 -t_srs EPSG:3003 -r near -ot Byte -srcnodata "0" -of GTiff %f F:/folder1/target_folder/%~nf.tif |
| 15 | |
| 16 | }}} |
| 17 | |
| 18 | |
| 19 | ---- |
| 20 | |
| 21 | Happy converting |
| 22 | Andrea Peri. |