Hello all,
I have downloaded ALL of the 1/3rd Arc Second Satellite data for the main part of the United States I.E not Alaska, Hawaii or any of the outlying US Islands.
I have run a report over all the data which is in GeoTiff format ( floating point tiff - with extra tag information ) to obtain all the information that I need which is :
Minimum height below sea level ( sea level treated as 0 )
Maximum height
No data values ( literally a value that represents no data )
NaN values ( A value that represents - Not A Number )
Longitude and Latitudes for the Top Left, Top Right, Bottom Left, Bottom Right of each image.
This has told me that I do have No Data Values and what the data for No Value is for each file, that I do have NaN values. That the values over all files for below sea level height is -111.04142 , the maximum height is 4414.2256.
I have written some python code to convert these files from GeoTiff floating point values to Unsigned Integer files compatible with Unreal’s .r16 heightmap format - except that they are WAY TO LARGE. Each 1 Arc second file at 1/3rd resolution I.E 1 pixel = around 10m is 10812 x 10812 pixels before conversion take about 480 Mb each.
My next step is to write some more python to convert the data into Unreal friendly sized .R16 file chunks each of which will have a standardized file name so I can control load order via a chunk loader; however before I do this I have struck some problems with being able to visualize the data - just because it is so HUGE to make sure my algorithm for conversion of floating point values to unsigned 16 bit values for import are at the correct height and I am scratching my head with regard to it…
So now you know the whole story what I am trying to determine is:
What should I set NaN values to when outputting from the floating point to Unsigned values.
What should I set No Data values to when outputting from the floating point to Unsigned values.
How should I set the data in general, at the moment I use the following Python snippet for conversion where BaseHeight is the minimum value from my reports + 1 as a positive value I.E: 112
NB: I’ve been looking at this so long I’m going cross eyed having processed 389 Gb of Satellite data in 1120 files so some input from somebody who has tried this sort of thing would be invaluable.
Thanks all, look forward to some responses.
if math.isnan(Array[x, y]):
data = 0
elif Array[x, y] == NoDataValue:
data = BaseHeight
else:
data = Array[x, y]
if data != 0:
NewHeight = BaseHeight + data
else:
NewHeight = data
Converted = int(NewHeight)
if Converted > 255:
lo = int(Converted % 256)
hi = int((Converted - lo) / 256)
else:
lo = int(Converted)
hi = int(0)
outme.write(bytes([hi]))
outme.write(bytes([lo]))