ImageMosaic regression between GeoServer 2.28.2 and 2.28.3: NumberFormatException when merging multiple TIFF granules

Hi,

I am seeing what appears to be an ImageMosaic regression between GeoServer 2.28.2 and 2.28.3.

I have an ImageMosaic consisting of GeoTIFF granules. With exactly the same data and configuration:

  • GeoServer 2.28.2 / GeoTools 34.2: works correctly

  • GeoServer 2.28.3 / GeoTools 34.3: fails

  • GeoServer 3.0.1 / GeoTools 35.1: fails

  • recent 2.28.x / GeoTools 34-SNAPSHOT: fails

  • recent 3.0.x / GeoTools 35-SNAPSHOT: fails

Behavior

Requests involving only a single granule render correctly.

When the requested BBOX intersects multiple granules, rendering may fail. This can be reproduced directly with WMS, so it does not seem to be related to GeoWebCache.

The relevant exception is:

java.lang.NumberFormatException: For input string: "178,29884233495"

    at java.lang.Double.parseDouble(...)
    at org.geotools.gce.imagemosaic.Utils.updateMDI(Utils.java:2334)
    at org.geotools.gce.imagemosaic.Utils.updateRasterBand(Utils.java:2322)
    at org.geotools.gce.imagemosaic.Utils.updatePamDatasets(Utils.java:2292)
    at org.geotools.gce.imagemosaic.Utils.mergePamDatasets(Utils.java:2265)
    at org.geotools.gce.imagemosaic.Mosaicker.createMosaic(Mosaicker.java:339)

I have seen the same exception with several values, for example:

169,78962803655
176,7898108829
166,30088104175
177,23066314594
168,95466278031
162,69203014978

It looks as if decimal values using a comma as the decimal separator reach Double.parseDouble() while PAM metadata from multiple granules is being merged.

What I have already tested

  • Removing all external .tif.aux.xml files does not help.

  • CheckAuxiliaryMetadata=false does not help.

  • There are no .ovr files in the minimal test dataset.

  • Setting the JVM locale to en_US does not help.

  • Direct WMS requests fail as well, so GWC does not seem to be involved.

  • An ImageMosaic containing one TIFF works.

  • Adding a second TIFF reproduces the problem when both granules are involved in rendering.

Possible regression point

Since the same dataset works with GeoTools 34.2 and starts failing with GeoTools 34.3, I noticed GEOT-7865 – “ImageMosaic Supporting PamDataset stored in TIFFMetadata”, introduced around this version boundary.

I also noticed GEOT-7909 – “Improve PAM dataset merge handling for partial or inconsistent PAM inputs”, but the issue is still reproducible with current 34.x and 35.x snapshot builds.

So GEOT-7865 seems potentially related, but I have not confirmed that it is the actual cause.

Has anyone encountered this issue?

Could this be a known problem with merging PAM/statistics metadata from TIFFs, particularly when the numeric metadata contains locale-formatted decimal values?

If this looks like a bug, I can provide a minimal two-TIFF reproducer and file a GeoServer/GeoTools issue.

Thanks!

Hi,

Do you have any chance to share the gdalinfo of one of those files? (where it reports the auxiliary info, i.e. the stats)

Do you have a sample pam xml file to share?

Please, let us know.

Daniele

Hello, gdalinfo here:

Driver: GTiff/GeoTIFF
Files: 32-41-09.tif
Size is 4215, 3479
Origin = (-781467.973612161469646,-1199721.100027236156166)
Pixel Size = (1.276442152098753,-1.276442152215168)
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( -781467.974,-1199721.100)
Lower Left  ( -781467.974,-1204161.842)
Upper Right ( -776087.770,-1199721.100)
Lower Right ( -776087.770,-1204161.842)
Center      ( -778777.872,-1201941.471)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=171.763, StdDev=96.133
NoData Value=256
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=171,76263430439
STATISTICS_STDDEV=96,132595192922
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=177.052, StdDev=100.287
NoData Value=256
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=177,05187198432
STATISTICS_STDDEV=100,28745029479
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=150.116, StdDev=90.049
NoData Value=256
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=150,11620538346
STATISTICS_STDDEV=90,048761104578

Driver: GTiff/GeoTIFF
Files: 32-41-10.tif
Size is 4212, 3478
Origin = (-776597.753844049759209,-1200395.465848706662655)
Pixel Size = (1.276529156719334,-1.276529156835750)
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  ( -776597.754,-1200395.466)
Lower Left  ( -776597.754,-1204835.234)
Upper Right ( -771221.013,-1200395.466)
Lower Right ( -771221.013,-1204835.234)
Center      ( -773909.383,-1202615.350)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=176.790, StdDev=98.903
NoData Value=256
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=176,7898108829
STATISTICS_STDDEV=98,903162947823
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=177.417, StdDev=101.693
NoData Value=256
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=177,41706456866
STATISTICS_STDDEV=101,69305604314
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
Min=0.000 Max=255.000
Minimum=0.000, Maximum=255.000, Mean=150.673, StdDev=90.791
NoData Value=256
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=150,67321611027
STATISTICS_STDDEV=90,791141133813

I can also share the tif files if necessary, but it is EPSG:5514, so the imagemosaic is specific.

Hello, I’ve been a long time user of GeoServer. Recently updated to GeoServerCloud 3.0.1 w/ PgConfig via Docker Compose, and I’m experiencing a similar issue w/ an ImageMosaic, and wanted to provide some of what I was seeing.

`Caused by: java.lang.NumberFormatException: For input string: “1481.400889997554,1219.533424194248,934.9155303665614,918.2658333652223”`

Behavior: Only present when viewing/rendering the layer via preview or via OGC services. Creating/updating of the ImageMosaic Store and Layer experience no issues.

Specifics:
-ImageMosaic store is backed by a PostGIS store (as per documentation). No changes to table contents have been made since the upgrade.

Happy to provide more context upon request.