TransWikia.com

I need to convert some GeoTIFF images to little endian scaled .R16 (16 bit raw files) for unreal engine import

Geographic Information Systems Asked by FalloutBoy on July 26, 2021

I have 1188 1/3rd ArcSecond resolution at 1 x 1 degree each which I wish to convert to unreal engines R16 ( Raw format ). I am working at this point in Python.

The problem is I can not tell how to store the data which needs to be stored which ranges from -111.04m to 4414.23m his apparently needs to be multiplied by 100 to put it into unreal units ( centimeters ) and then divided by 512 or if you prefer multiplied by 0.001953125, and the result stored in an unsigned word in little endian format.

Now as far as I have been able to ascertain, unreal .R16 files are Unsigned 16 bit words per height point.

0x0000 is the lowest point, 0x00B0 is the middle point and 0xFFFF is the high point
Bare in mind that the middle value is stored this way but actually reads 0xB000 in hex normally.

So with the range of my values being -111.04 to 4414.23 I will have add 112 to both ends in order to take into account "below sea level values on land" which gives me a range of 0 to 4526.23.

Looking at the top value and multiplying it by 100 I get 452623cm then divide by 512 I get 884.029296875.. Now 884 I can actually store by converting to hi low bytes and storing it but I would lose quite a range of values.

Can anyone tell me how I would store this data in an unreal R16 file without data loss (without referring me to a 3rd party program to do the job)?

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