This tutorial explains how to import your terrain into Unreal Engine.

When you have completed your terrain, export it using the file format Raw16, which is the optimal format according to EPIC. In this example, we have created a simple 2048x2048 terrain.

In Unreal Engine, click on the Landscape icon and import your heightmap. The data fit automatically to your file. Click on Import.

The terrain imports, but the padding is untidy and the terrain looks flat. Now, we will fix this quickly.

The table below lists the optimized landscape sizes recommended by EPIC, which guarantee a borderless terrain. The table is available at https://docs.unrealengine.com/latest/INT/Engine/Landscape/TechnicalGuide/.

Crop the 2048x2048 terrain to a recommended resolution of 2017x2017. A height of 100 in the Z scale corresponds to a height of -256 m min. to 256 m max. Accordingly, 200 in the Z scale corresponds to a height of -512 m min. to 512 m max., 400 to a height of -1024 m min. to 1024 m max., etc.

Check the min. and max. heights of the terrain and export it with a defined height to the nearest power of 2.
In this example, the heights are -467.04 min. to 224.70 max., therefore, the terrain is exported with a defined height of -512 min. to 512 max.

Reimport the terrain into Unreal and set the Z scale to 200.

When the terrain is reimported, the landscape data fit automatically to your new heightmap resolution, according to EPIC's recommended sizes.

The padding disappears and the heights appear correct.