Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm looking for a function similar to GRASS r.resample. I have a folder full of TIF files and want to reduce their resolution ("scale them down") to reduce file size.

share|improve this question

1 Answer 1

up vote 10 down vote accepted

Your best bet would appear to be gdalwarp, which is documented over here. It's trivially easily scriptable, but the details would depend on your operating system. In Windows, you'd do something like:

for %i in (*.tif) do gdalwarp -ts 1600 0 -r cubic -co "TFW=YES" %i %~ni_small.tif

which should reduce the input files to 1600 pixels wide, saving the file with the original name appended with "small". This is seriously untested, ymmv. Besides, you're probably using Linux - if so, post back, and someone can help there. Ditto if you're looking for a Python solution.

Edited: added parameter to create ESRI world file. Note that this solution doesn't specify the output format, so it's a GeoTiff by default

share|improve this answer
    
This works, thank you. One might just want to add "-co TFW=YES". –  underdark Sep 8 '10 at 9:57
    
Good catch, thanks. That'll save some frustration. –  Herb Sep 8 '10 at 11:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.