Error while writting a SAR preprocess image to a geotiff-bigtiff

Whenever SAR preprocessed image going beyond than 4 giga byte in GeoTIFF format.its giving a java run time error.if the preprocessed image is less than 4gb then GeoTIFF format is working fine and getting a preprocessed correct image.

Code:

parameters = HashMap()
parameters.put(‘demResamplingMethod’, ‘NEAREST_NEIGHBOUR’)
parameters.put(‘imgResamplingMethod’, ‘NEAREST_NEIGHBOUR’)
parameters.put(‘demName’, ‘SRTM 3Sec’)
parameters.put(‘pixelSpacingInMeter’, 10.0)
parameters.put(‘sourceBands’, ‘Sigma0_’ + polarization)

  terrain = output + date + "_corrected_" + polarization 
  target_2 = GPF.createProduct("Terrain-Correction", parameters, subset) 
  ProductIO.writeProduct(target_2, terrain, 'GeoTIFF')

So ,i have changed the format to GeoTIFF-BigTIFF .then this code is taking more than 1-2 hours and generate a big tif image with ~5 gb.but array of the image is filled with zeros.i am thinking ,its a corrupt image because its showing black with wrong geo-coded in qgis.

Also ,i have tried with NetCDF-CF format .its not working.

The writing might be faster if you use a different method to write the output.
Please try:

GPF.writeProduct(target_2, terrain, 'GeoTIFF-BigTIFF', false, ProgressMonitor.NULL)

You can enable compression for BigTiff.
There a system property needs to be set. You can do it at the beginning of your script.

JavaSystem = jpy.get_type('java.lang.System')
JavaSystem.setProperty('snap.dataio.bigtiff.compression.type', 'LZW')

Thanks for your response!

First ,I have added system property for enable compression for BigTiff at beginning of my script.Now, its taking less than 40 mins and created a file with ~10mb .But image 2d array filled with zeros and not geocoded properly.

JavaSystem = jpy.get_type(‘java.lang.System’)
JavaSystem.setProperty(‘snap.dataio.bigtiff.compression.type’, ‘LZW’)

in this case, my WriiteProduct syntax look like:

GPF.writeProduct(target_2, terrain, ‘GeoTIFF-BigTIFF’)

Second, i have tried with your suggestion adding parameters to writeProduct function.

GPF.writeProduct(target_2, terrain, ‘GeoTIFF-BigTIFF’, False, ProgressMonitor.NULL)

Its giving this error.

ProductIO.writeProduct(target_2, terrain, ‘GeoTIFF-BigTIFF’, False, ProgressMonitor.NULL)
RuntimeError: no matching Java method overloads found.

But, This same code is running fine with GeoTIFF format .when image size is lesser than 4gb and getting correct preprocessed image.