5

Gdal_translate implemented in QGIS is often recommended for converting to Ascii-Grid. My problem is that every output which is generated from my geotiff-raster layer is binary instead of plain-text in my Editor.

gdal_translate -of GTiff D:/.../lu_krs_attr.tif D:/.../grid/test_grid.asc

How can I generate an Ascii-Grid-File in plain-text with header etc?

The GTiff was originally created in an Arc*-Software, it has 1 channel and a raster attribute table implemented (which is not assigned in QGIS and which I don't want to convert either).

9

Yes, on the command line, look on Gis StackExchange (convert geotiff to simple xyz elevation file? or What are the appropriate parameters to convert .asc file to geotiff using gdal_translate? or ...):

gdal_translate -of GTiff lu_krs_attr.tif test_grid.asc

convert the lu_krs_attr.tif to another tif file, even with asc. in the resulting filename

gdal_translate -of AAIGrid lu_krs_attr.tif test_grid.asc 

convert the lu_krs_attr.tif to an ASCII grid

gdal_translate -of GTiff testgrid.asc test_grid.tif

reverse

And you have the command to use in QGIS

  • Thanks for your answer! The command "gdal_translate -of AAIGrid file.tif file.asc" ist the right one (and the only one, which was necessary). It turned out that the Userform in Qgis didnt' generate the right syntax concerning the "-of". I better learn the syntax for better results and even more translation-operations... – user24104 Nov 20 '13 at 16:11
3

I had the same problem "translating" geotiff files (downloaded from worldclim)to ASCII grid files in QGIS 2.6.1.

I solved it by typing -ot Int 32 after the translation command and before the file path:

gdal_translate -of AAIGrid -ot Int 32 D:/.../lu_krs_attr.tif D:/.../grid/test_grid.asc

The idea is from http://clp-foss4g-workshop.readthedocs.org/en/latest/qgis_raster_resample.html

  • Modified the above slightly for the -ot to Int16 and it works on my Ubuntu machine: gdal_translate -of AAIGrid -ot Int16 D:/.../lu_krs_attr.tif D:/.../grid/test_grid.asc – user3661804 Aug 9 '16 at 18:31
  • 1
    Shouldn't it be Int32 instead of Int 32? – AndreJ Aug 10 '16 at 6:05

Your Answer

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

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