4

I am new to QGIS or any GIS software. I have been using a totalstation to measure a hillside and I am trying to convert the point cloud to a 16bit png heightmap that I can use in Unreal Engine 4.

I have tried using interpolation and print composer in QGIS but the landscape in UE4 looks blocky, like minecraft.

What am I doing wrong?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Gisnoob123
  • 127
  • 2
  • 10
  • 1
    print composer with higher dpi needed see https://gis.stackexchange.com/questions/3718/controlling-image-output-settings-in-qgis – Mapperz Jun 05 '17 at 14:55

1 Answers1

3

I'm guessing that you're seeing quantization - the output comes out looking "terraced", like rice fields. If that's the case it's because you're outputting 8 bit png, which only has 256 possible values.

you can do this with the command line tool gdal_translate. You should be able to run this from the terminal (linux/mac) or the osgeo4w shell (windows). I don't think you can do this from QGIS (correct me if I'm wrong)

assuming you've got a 1-band raster with float values in the range MIN to MAX, you can use

gdal_translate -of PNG -ot UInt16 -scale MIN MAX 0 65535 "source.tiff" "output.png"

replace MIN and MAX in that command with the minimum/maximum values in your raster. Make sure you set the MAX value to the full range, or the heightmap will be clipped, giving an appearance of mesas.

That will output a Unsigned Integer 16 bit png, with your float values mapped across the full 16-bit range of values.

You can find the real min/max using QGIS, or use the gdalinfo command line

gdalinfo -mm "source.tiff"

... and look at the metadata section for the minimum and maximum values. (-mm forces it to calculate the true range of values, rather than an estimate)

Steven Kay
  • 20,405
  • 5
  • 31
  • 82