1

I'd like to export 127 raster files from grass to .tif in one operation. I already stumbled over this post How to batch export using r.out.gdal command in GRASS but it doesn't work (I don't even know exactly where to enter this -python console or command shell?).

I'm not too familiar with programming, so I hope there's a simple solution.

  • The answer in the post that you mentioned definitely works. It is intended to be run in a bash shell. Yu can do a similar loop in python if you prefer. Can you show what you did that doesn't work? – Micha Aug 25 '15 at 17:11
  • Thanks for your reply. I enter it in the command console as follows: for file in $NPPFILES; do r.out.gdal input=$file output=$file.tif format=GTiff ; done which results the following: "file" kann syntaktisch an dieser Stelle nicht verarbeitet werden. ("file" cannot be processed in this place, syntax error) Perhaps I should mention I'm using Windows7 w/o admin rights. – Flo Sep 7 '15 at 12:19
  • The previous post refers to a bash shell. You will have to write the equivalent commands for windows cmd. Maybe this post: stackoverflow.com/questions/2591758/batch-script-loop will give you some ideas – Micha Sep 8 '15 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.