I am trying to convert a digital elevation model in txt file format to a raster file (tiff) with qgis.
The file format is *.dat. The coordinate system is Gauss Krüger, Bessel, 5. meridian.
First I imported the txt file with the appropriate coordinate system. Now I want to convert it to a raster file. However the viewed data are black and I dont see any heights. What did I do wrong? Follow the link to view the screenshot of the imported dem in qgis:
Screenshot qgis
When zooming in it looks like this:
Screenshot zoomed in
This is an example of the data:
LATITUDE LONGITUDE HEIGHT
5390.0125 5659.9875 258.6
5390.0125 5659.9625 252.6
5390.0125 5659.9375 243.9
5390.0125 5659.9125 237.1
5390.0125 5659.8875 234.5
5390.0125 5659.8625 231.2
5390.0125 5659.8375 233.7
Best Answer
I believe we are talking here about regular DEM XYZ text file. The issue is that you need to have your XYZ data in very specific order to be able to read as GRID (Gridded XYZ)
Once you have that you can use gdal_translate (In QGIS Raster / Conversion / Translate...)
A while back I created a python script which can be used for ordering XYZ data into proper order and filling up the missing data. Unfortunately I don't own rights to make that script publicly available.
What I can suggest instead if you can't make script yourself is to do it this way manually:
I suggest to read manual on GDAL rasterize to be abble to adjust rasterize function to exactly what you need.