[Geoserver-devel] [JIRA] (GEOS-11028) Cannot use COG on GCS

Samo Dadela created an issue

GeoServer / BugGEOS-11028

Cannot use COG on GCS

Issue Type:

BugBug

Affects Versions:

2.23.0

Assignee:

Unassigned

Components:

Community modules

Created:

15/Jun/23 8:35 PM

Environment:

kartoza/geoserver 2.23.0

Priority:

MediumMedium

Reporter:

Samo Dadela

I’m trying to configure GeoServer to use COGs that are located on GCS (Google Cloud Storage).
I’m using an ImageMosaic that was previously configure to use local files. I moved all files to the a GCS bucket, set GOOGLE_APPLICATION_CREDENTIALS (verified with /vsigis/).

I followed the tutorial for S3, modifying things for GS: https://docs.geoserver.org/latest/en/user/community/cog/update.html

I added the following (both to the imagemosais.properties and to indexer.properties):
{{Cog=true
SuggestedSPI=it.geosolutions.imageioimpl.plugins.cog.CogImageReaderSpi
CogRangeReader=it.geosolutions.imageioimpl.plugins.cog.GSRangeReader}}

The I changed the ‘location’ column as per instructions - though here I’m not sure what to put… The documentation says that GS supports urls starting with gs:// or https://storage.cloud.google.com. Then I read somewhere that they should start with cog://. I tried all the possible combinations gs://, cog://gs://, cog://https://strorage.cloud.google.com.
I also tried to change the PathType parameter to ABSOLUTE, RELATIVE,URL with no avail (btw latest documentation says that I should use AbsulutePath=true - instead of PathType=ABSOLUTE).

The problem is I always get the same error… something like:
{{15-Jun-2023 18:28:24.667 WARNING [pool-2-thread-4] it.geosolutions.imageioimpl.plugins.cog.CogSourceSPIProvider.createRangeReaderInstance Unable to create a RangeReader of type it.geosolutions.imageioimpl.plugins.cog.GSRangeReader on uri: //bucket/dir/file.tif due to java.lang.reflect.InvocationTargetException
15 Jun 18:28:24 DEBUG [imagemosaic.catalog] - Creating new Granule Descriptor for feature Id: orthophotos_ndvi/orthophotos_ndvi.596616
15 Jun 18:28:24 DEBUG [imagemosaic.catalog] - Skipping invalid granule
java.lang.IllegalArgumentException: Illegal argument: “granuleLocation=cog://gs://bucket/dir/file.tif”.
at org.geotools.gce.imagemosaic.GranuleDescriptor.extractRasterGranule(GranuleDescriptor.java:964)
at org.geotools.gce.imagemosaic.GranuleDescriptor.<init>(GranuleDescriptor.java:909)
at org.geotools.gce.imagemosaic.catalog.CachingDataStoreGranuleCatalog.getGranuleDescriptor(CachingDataStoreGranuleCatalog.java:244)
at org.geotools.gce.imagemosaic.catalog.CachingDataStoreGranuleCatalog.lambda$parallelGranuleVisit$1(CachingDataStoreGranuleCatalog.java:143)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
15 Jun 18:28:24 DEBUG [imagemosaic.catalog] - Parallel granule visit using executor java.util.concurrent.ThreadPoolExecutor@anonymised.com[Running, pool size = 5, active threads = 0, queued tasks = 0, completed tasks = 5114]
15 Jun 18:28:24 DEBUG [geotools.jdbc] - CLOSE CONNECTION}}

I’d expect that this
Unable to create a RangeReader of type it.geosolutions.imageioimpl.plugins.cog.GSRangeReader on uri: //bucket/dir/file.tif

should read:
Unable to create a RangeReader of type it.geosolutions.imageioimpl.plugins.cog.GSRangeReader on uri: gs://bucket/dir/file.tif

… but the path/uri is always ‘cut’ wrong.

I always reload the configuration after each change.

If you could provide an example of the settings needed and how the location path should be correctly encoded, I’d be very grateful.

BTW: I also can’t manage to setup a simple GeoTiff store with just one COG image. I check the COG checkbox but I don’t know what to type in the file/path url - again tried cog://, cog://gs and various other combination to now avail.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100226-sha1:d46780b)

Atlassian logo