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.