1

I am trying to batch convert a set of JPEGs into ASCII text files. Below is the code I am running (I added the "..." for privacy, it does not actually appear in the code).

gdal_translate -b 1 -of AAIGrid "C:/Users/.../Cropped Pixel Profile Images/*.jpg" "C:/Users/.../Cropped Pixel Profile Images/ASCII Converted Files/*.txt"

The message I am getting back is ERROR 6: Too many command options 'C:/Users/.../Cropped Pixel Profile Images/-10EV.jpg'.

I would just do this whole process through the "translate batch mode" GUI in QGIS, except that I need to add -b 1 to the code, which can't be done for batch processed items (maybe that's a potential bug/ feature request for future versions of Q).

I am also looking for a way to execute this within QGIS, so that I can run the same command on both OSX and Windows. (If it is platform specific, what is the same command for terminal in OSX).

Anybody have any idea why I am running into this error?

Fireycold
  • 121
  • 6
  • 1
    I don't work on Windows, but this looks like the wildcard is being expanded and you are supplying too many files. I doubt gdal_translate has built in support for batch processing. Maybe a simple for loop could be used? – Logan Byers Feb 24 '17 at 02:45
  • 1
    for %i in (*.jpg) do gdal_translate -b 1 -of AAIGrid %i %i.txt – user2856 Feb 24 '17 at 02:51
  • What would above command be for OSX, or if executed from within QGIS? – Fireycold Feb 25 '17 at 07:12

0 Answers0