Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

Suitable raster format for elevation data with sub-meter accuracy?

$
0
0

I’ve got some elevation data represented in ascii gridded xyz-files which I want to convert to a conventional raster format. What’s a bit special is that the elevation values have sub-meter accuracy, as they have one decimal (for example: ’101.7′)

As a rule I prefer to use open source software and stick to conventional, open, widely supported formats.

So the first thing I tried was to convert the data using gdal to geotiff, but specifying the data-type as Float32/64 distorted the elevation values somewhat. When I check the pixel-value in qgis it reports it as 101.70001220703125.

The command I use to convert an ascii file into raster is:

gdal_translate -ot Float32 -a_srs "EPSG:32633" -co "TILED=YES" -co "COMPRESS=LZW" -co "PREDICTOR=2"  -co "ZLEVEL=9" file.txt file.tif

Questions:
What would be suitable raster formats for sub-meter elevation data?
Is there any other software I should consider using instead of gdal?
Is this distortion of decimal precision perhaps inherently unavoidable? (Some doubts have been raised in the comments below though).

Edit:
Some more information about the original text format:
I cannot disseminate this data and provide a real example, but the original format is rather trivial. The text files contain UTM coordinates for a specific zone, 33N for example. The spacing between the points are regular, with a spacing of 5 meters between them. Just as an example two adjacent XYZ values would be:
680000 5420000 101.7
680005 5420000 101.3

Actually, it should be possible to use just the above two lines and invoke gdal_translate as described above, it should be sufficient to discern how gdal handles the numerical precision.


Viewing all articles
Browse latest Browse all 397

Latest Images

Trending Articles



Latest Images