1

I am searching for a way to convert the european DEM (EU-DEM https://www.eea.europa.eu/data-and-maps/data/eu-dem#tab-european-data) to (xy)z. In fact I'd only like to obtain the z-data (elevation). Input format is geoTiff.

I tried the conversion geoToff to xyz using the "gdal2xyz" plugin. The only problem - disk space. Even converting "small" geoTiffs (~200MB) of course results in a huge xyz-file >20GB. I want to convert a input-file size 22.3GB (!)

Basically I don't need the x and y, only the z (elevation). Each z-Point could be addressed by selecting the correct line in the output-file.

A litte background: This dataset (csv/txt) will be used in a microcontroller (80MHz, ~100kB RAM) application from a SD-Card. I will have a basic file system (FatFS) where I can jump to a desired line.

How do I convert to a "z-file"?

  • Have you looked into the AAIGrid format? – AndreJ Aug 9 '17 at 17:49
1

Did you try AAIGrid as suggested by @AndreJ?

Example with a white 10 by 10 sized box:

gdal_translate -of aaigrid 10by10.tif 10by10.asc

Result:

ncols        10
nrows        10
xllcorner    950.000000000000
yllcorner    50.000000000000
cellsize     100.000000000000
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255
 255 255 255 255 255 255 255 255 255 255

However, if size matters perhaps you should stay with simple binary raster format like png and use some ready made library for reading the pixel values?

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.