2

I do not understand the command line when I try to work with gdal_translate in QGIS. I found this at the forum: Normalize raster values to 0-255

And tried this:

"If not, from within QGIS choose Raster -> Conversion - > Translate. Choose your files and options. At the bottom of the window the full gdal_translate command will be displayed. Click edit and add the -scale option."

When I type the following command into the line I get an error message "wrong parameters"??? Maby the commands are wrong.

enter image description here

My current grid file has a range from 1 to 9. I need to have a range from 1 to 5 (5 classes).

6
  • 1
    have you tried running it without the brackets and commas, i.e. -scale 1 9 1 5 ? In general, try running it from the command line as it should give you more descriptive error messages.
    – dmci
    Commented Mar 27, 2013 at 8:18
  • 1
    Looks like the closing quotation marks are missing, as well as the input layer. This must be a file.
    – AndreJ
    Commented Mar 27, 2013 at 8:34
  • 1
    yes, as Andre Joost mentions you are also missing the input layer. the command should read as follows: gdal_translate "C:/Tempordner/Your/Input/Image.tif -scale 1 9 1 5 -of GTiff "C:/Tempordener_GIS/QGIS_test/Normalised_Grid.tif"
    – dmci
    Commented Mar 27, 2013 at 11:13
  • Still one quotation mark too much or missing ;-)
    – AndreJ
    Commented Mar 27, 2013 at 12:12
  • 1
    :-) good point - unaccustomed to using them! gdal_translate "C:/Tempordner/Your/Input/Image.tif" -scale 1 9 1 5 -of GTiff "C:/Tempordener_GIS/QGIS_test/Normalised_Grid.tif"
    – dmci
    Commented Mar 27, 2013 at 12:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.