geosolutions-it / imageio-ext

Additional plugins and extension for the standard Java ImageIO library
Other
139 stars 80 forks source link

COG S3: image mosaic with objects in folders on S3 not working #300

Open mhn17 opened 4 months ago

mhn17 commented 4 months ago

Hi,

When creating an image mosaic where the COGs are stored in a folder on S3, the layer is broken. The layer preview shows a black image and the logs contain the error message:

SEVERE [http-nio-8080-exec-6] it.geosolutions.imageioimpl.plugins.cog.S3RangeReader.readHeader Error reading header for ...

The problem is the creation of the GeoTIFF URL which is returned as "https://##BUCKET_NAME##/##OBJECT_ID##", omitting the path section.

Example: Object S3 URI: s3://bucket-name/path/to/object/file1.tiff Created URL: https://bucket-name/file.tiff