TransWikia.com

Convert GeoTIFF height map to raw file for Unity terrain

Geographic Information Systems Asked by Hdot on May 13, 2021

I have a GeoTIFF file that QGIS has produced from merging multiple DEM TIFFs together. The gdalinfo for this file is:

Driver: GTiff/GeoTIFF
Files: ca_heightmap.tif
Size is 39601, 39601
Coordinate System is:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["geodetic latitude (Lat)",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["geodetic longitude (Lon)",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-125.000138888888998,43.000138888888898)
Pixel Size = (0.000277777777778,-0.000277777777778)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (-125.0001389,  43.0001389) (125d 0' 0.50"W, 43d 0' 0.50"N)
Lower Left  (-125.0001389,  31.9998611) (125d 0' 0.50"W, 31d59'59.50"N)
Upper Right (-113.9998611,  43.0001389) (113d59'59.50"W, 43d 0' 0.50"N)
Lower Right (-113.9998611,  31.9998611) (113d59'59.50"W, 31d59'59.50"N)
Center      (-119.5000000,  37.5000000) (119d30' 0.00"W, 37d30' 0.00"N)
Band 1 Block=39601x1 Type=Float32, ColorInterp=Gray

enter image description here

How can I convert this to a raw file that I am able to import as a terrain in Unity? When I open this TIFF in GIMP, I just get a black/white image that loses the height map aspect (I’m not really sure what happens to it, but it looks like this in GIMP)

enter image description here

One Answer

Using the command gdal_translate –of ENVI –ot UInt16 –scale –outsize 1025 1025 ca_heightmap.tif heightmap.raw I was able to get the correct format for Unity

Correct answer by Hdot on May 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP