Is it possible to get a proper terrain-like height map?
Let's say you have a landscape like this:



Set the camera to orthographic mode, and place it so that is perpendicular to the landscape.

Adjust the Orhographic scale so that the landscape is completely viewable through the camera (You might need to adjust the render resolution size in the render settings)


Render the image.

In the compositor connect the depth socket of the render layer to a Vector->Normalize Node. (This will convert the depth information to a scale from 0 to 1). 

Make sure that the Display Device in the color management section is set to None (so that the image information is not distorted using a view transform).



When importing into other software you will need to set the image to be interpreted as data, not using any color transform.

The quality of the heght map will depend on the amount of detail in the original geometry of the landscape, and of the size (in pixels) of the final image.