Infinite no-data value not handled correctly

I found an issue with no-data values. I opened a GeoTiff (GDAL reader) and when opening the image the following dialog is shown:

When using the plain SNAP reader this happens already when reading the the file:

java.lang.NumberFormatException: For input string: "-inf"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.base/java.lang.Double.parseDouble(Double.java:792)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.initializeFromMetadata(TIFFImageReader.java:1324)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:865)
	at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getImageMetadata(TIFFImageReader.java:1476)
	at org.esa.snap.dataio.geotiff.GeoTiffImageReader.getImageMetadata(GeoTiffImageReader.java:131)
	at org.esa.snap.dataio.geotiff.GeoTiffImageReader.readNoDataValue(GeoTiffImageReader.java:310)
	at org.esa.snap.dataio.geotiff.GeoTiffImageReader.<init>(GeoTiffImageReader.java:91)
	at org.esa.snap.dataio.geotiff.GeoTiffImageReader.buildGeoTiffImageReader(GeoTiffImageReader.java:359)
	at org.esa.snap.dataio.geotiff.GeoTiffImageReader.buildGeoTiffImageReader(GeoTiffImageReader.java:330)
	at org.esa.snap.dataio.geotiff.GeoTiffProductReader.readProductNodesImpl(GeoTiffProductReader.java:96)
	at org.esa.snap.core.dataio.AbstractProductReader.readProductNodes(AbstractProductReader.java:181)
	at org.esa.snap.core.dataio.ProductIO.readProduct(ProductIO.java:180)
	at org.esa.snap.rcp.actions.file.ReadProductOperation.run(ReadProductOperation.java:61)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1420)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)

The file is read and handled correctly in QGIS for example.

Thank you for reporting this issue. Could you please provide the file that caused the error?

I’ve attached it here:
B1.tif (4.4 MB)

Jira ticket SNAP-4221 created.

1 Like