2

I have a DTM file, txt format, I would like to convert it into GeoTIFF, how can I do with the software grass?

ncols         1329
nrows         1152
xllcorner     1693884
yllcorner     5080341
cellsize      5
NODATA_value  -9999
1120.142 1119.698 1119.085 1118.423 1117.761 1117.164 1116.76 1116.354 1115.948 1115.546 1115.151 1114.757 1114.265 1113.767 1113.534 1113.508 1113.482 1113.955 1114.433 1114.91 1115.124
2
  • It depends on the format of the text file. Can you add some sample lines into your question?
    – AndreJ
    Oct 23, 2014 at 10:59
  • Ok, Yes I added.
    – Filippo
    Oct 23, 2014 at 12:52

2 Answers 2

1

In GRASS GIS, use r.in.arc for the import or simply r.in.gdal (Menu: File -> Import raster data -> Common formats import). This should read the file right away.

0

The format looks like AAIGrid, see How can I convert a ascii file to geotiff using Python? for an example.

You can use gdal_translate to convert it to geotiff:

gdal_translate -of "GTiff" fname.asc outname.tif

The file extension .asc is important to tell gdal which format to use.

Or use the python code from the linked question.

Your Answer

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

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