1

I have a set of 32-bit TIFF files of DTM data (50 sm) and I need to save them as 16-bit.

In order to save some space, I compressed them using LZW algorith and saved as 16 bit tiffs using Arcpy.

But I see that the precision of height of compressed DTM is not preserved.

Is there a way to preserve it?

import arcpy
import os

arcpy.env.workspace = r"D:\Venera_Workflow\COMpression_TEST\TEST_uncompressed_input"
rasList = arcpy.ListRasters()
outWS = r"D:\Venera_Workflow\COMpression_TEST\TEST_Output_LZW"
arcpy.env.compression = "LZW"
for ras in rasList:
    arcpy.CopyRaster_management(ras, os.path.join(outWS, ras, ), "", "", "", "NONE", "NONE", "16_BIT_SIGNED")

picture

1

16 bit signed integers can only store whole numbers between -32768 to 32767.

Either keep in 32 bit floating point (and compress) or multiply by 10 before saving to 16 bit int to keep 1 decimal place, ie 483.41 becomes 4834.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.