For a hobby flight simulator C++ project, satellite RGB and elevation data is needed. Since a few days I am trying Google Earth Engine. It is amazing at showing the data as a map. I see GeoTIFF export options, but I don't know how to load/convert that data into C++.

Is there a possibility to export a binary file?

For example where each pixel is represented by 5 bytes: RGBEE. (EE being a 16-bit int representing the elevation in meters.)

So the binary file would be of this format RGBEERGBEERGBEE...RGBEE with a total length of 5 times the number of pixels. Example: map of 100 by 100 pixels > file size= 50000 bytes.

1 Answer 1


You could export a GeoTiff from a suitable Digital Elevation Model (DEM) and from your satellite image.

Then you could extract lat/long and elevation from your DEM like here: Export the elevation values and its corresponding lat and long as a csv file in GEE

Then find the coordinates of your pixels in your GeoTiff satellite image with the rgb data (take care they have the same coordinate reference system) How to find coordinates of pixels of a GeoTIFF image with Python

How to export a RGB image from Google Earth Engine?

Last step is the combination of both data sets. Use the coordinates to connect colour and elevation.

But in your binary format you only keep the elevation, your position (lat/long) info has gone.

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.