Output 'GeoTIFF-BigTIFF'

Hello,
I use snap version snappy-7.0.0, to obtain an image from a band math.
I don’t know how to write the output with ‘.tif’. There is a snippet:

output_product = Product(‘NDVI’, ‘NDVI’, width, height)
ProductUtils.copyGeoCoding(product, output_product)
output_band = output_product.addBand(‘ndvi’, ProductData.TYPE_FLOAT32)

for y in range(height):
red_row = red_band.readPixels(0, y, width, 1, red_row)
nir_row = nir_band.readPixels(0, y, width, 1, nir_row)
ndvi = numpy.divide((nir_row - red_row),(nir_row + red_row))
output_band.writePixels(0, y, width, 1, ndvi)

But I don’t know how to write the output ???
output_product_writer = ProductIO.getProductWriter(‘GeoTIFF-BigTIFF’)
output_product.setProductWriter(output_product_writer)
output_product.writeHeader(‘ndvi_output.tif’)

or
ProductIO.writeProduct(, , “GeoTIFF-BigTIFF”)
ProductIO.writeProduct(output_band, “band”, " GeoTIFF-BigTIFF ")

I got the error message: no matching Java method overloads found

With BEAM-DIMAP, it’s ok, but I want to write my output with geotiff instead of *.dim,
How can I solve this problem?

Any help will be much appreciated.

Please try this:
ProductIO.writeProduct(band, outputFileName, 'GeoTiff')

[<space> added for clarity], also note different opening () and closing ()quotes

>>> set(" “band”, \" GeoTIFF-BigTIFF \"")
{'d', 'i', ',', 'b', 'g', 'F', 'G', 'a', '"', 'I', '”', 'o', '-', 'B', '“', 'T', 'e', ' ', 'n'}

Be careful with spaces and “look-alike” symbols (dashes and quotes have multiple variants in Unicode) that some text editors like to sprinkle through your files. Use a
“programming” editor (vi, emacs, etc.).

1 Like

Thank you so much for your help. It works using ProductIO.getProductWriter(‘GeoTiff’)

but when I tried with ‘GeoTIFF-BigTIFF’ it doesn’t work:

SEVERE: org.esa.snap.core.util.SystemUtils$SnapImagingListener: JAI error occurred: ‘Problem occurs when computing a tile by the owner.’ at com.sun.media.jai.util.SunTileScheduler@6371c5ec
java.lang.IllegalStateException:
I don’t’ know why?