[Geoserver-users] ImageMosaic + S3-Geotiff

Hi All !

Is there a way to make ImageMosaic datastore to access granules via S3
protocol?

Our ImageMosaic index is handled by a PostGIS table and location attribute
is set to 's3://bucket/objectkey'.
Also we have S3-Geotiff plugin installed and it works correctly for its own
datastore.

Can we achieve our goal by setting SPI in mosaic.properties like
PathType=URL
SuggestedIsSPI=org.geotools.s3.S3ImageInputStreamImplSpi
SuggestedSPI=org.geotools.s3.geotiff.S3GeoTiffReader

Thank you in advance.

Best Regards, Boris.

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

I have tried to do the same.

SuggestedSPI=org.geotools.s3.geotiff.S3GeoTiffReader fails with this
exception: https://pastebin.com/bKPRVuKR

Is there a way to modify S3GeoTiffReader to allow it to be instantiated in
AbstractGTDataStoreGranuleCatalog
<https://github.com/geotools/geotools/blob/master/modules/plugin/imagemosaic/src/main/java/org/geotools/gce/imagemosaic/catalog/AbstractGTDataStoreGranuleCatalog.java#L132&gt;
?

I'm running Geoserver 2.16-RC so that I have this fix
<https://github.com/geotools/geotools/commit/67a8a27e524a16656b9211255800b87674423286&gt;
, which I thought may have been causing issues with S3GeoTiffReader.

I found this comment
<https://github.com/geotools/geotools/pull/1829#discussion_r184628591&gt;
from a pull request for issue GEOT-5956
<https://osgeo-org.atlassian.net/browse/GEOT-5956&gt; which suggests that
using S3 in an ImageMosaic may be possible, but I couldn't find anything in
the documentation. I may be on the wrong track with using S3GeoTiffReader
for the SuggestedSPI.

My complete mosaic.properties:

SuggestedSPI=org.geotools.s3.geotiff.S3GeoTiffReader
SuggestedFormat=org.geotools.s3.geotiff.S3GeoTiffFormat
SuggestedIsSPI=org.geotools.s3.S3ImageInputStreamImplSpi
TimeAttribute=ingestion
ExpandToRGB=false
TypeName=cog_ground_cover_s3geotiff
Name=cog_ground_cover_s3geotiff
LevelsNum=9
PathType=URL
Heterogeneous=true
Caching=false
HeterogeneousCRS=true
LocationAttribute=location
Levels=30.0,30.0 119.99021526426077,119.99503311235458
239.9804305282887,239.99006622517481 479.8565217391588,479.98013245034963
959.7130434783176,959.9602649006993 1919.4260869566351,1917.3809523810633
3832.1875,3834.7619047621265 7664.375,7629.1578947366215 15328.75,15099.375
CheckAuxiliaryMetadata=false
MosaicCRS=EPSG\:3577
AbsolutePath=true

Kind regards,
Andrew

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html