> > The s3-geotiff module is not doing range reads, it can read any tiff, even 
> > non cog, and does read blocks of 5MB caching them on disk.
> >
> > Full COG support is built into the gt-geotiff module... But has currently 
> > no caching and requires COG layout. You should find an example of usage 
> > among the tests.
>
> oh, I see, thank you so much. Will check that out.

I am not sure what you mean by COG layout. I couldn't find any
reference in the testcases or source code.
I am assuming it should be set inside the GeneralParameters part?
Right now using "standard" general parameters I again get the coverage
of the complete tiff instead of a range of it.

Even if setting the source SPI provider to (as seen in the test):

String url = 
"https://minio.myinstance.org/cogs/eu_dem_v22_itnord4326_cog512.tif";;
BasicAuthURI cogUri = new BasicAuthURI(url, false);
HttpRangeReader rangeReader = new HttpRangeReader(cogUri.getUri(),
CogImageReadParam.DEFAULT_HEADER_LENGTH);
CogSourceSPIProvider input = new CogSourceSPIProvider(cogUri, new
CogImageReaderSpi(), new CogImageInputStreamSpi(),
rangeReader.getClass().getName());

Do you happen to have an example that uses COG layout?

Thanks a lot,
Andrea




> > Il Mar 6 Set 2022, 09:46 andrea antonello <andrea.antone...@gmail.com> ha 
> > scritto:
> >>
> >> Hello,
> >> I wanted to test the s3 geotiff module to read cogs from a minio instance.
> >>
> >> It was actually quite simple to set up, but I have not been able to do
> >> range requests.
> >> The whole image seems to be read every time instead.
> >>
> >> Can anyone with experience tell me what I might be doing wrong?
> >>
> >> My super simple code is this:
> >>
> >> System.setProperty("s3.properties.location", "/path/to/s3.properties");
> >> S3GeoTiffReader reader = new S3GeoTiffReader(new
> >> S3ImageInputStreamImpl("main://cogs/eu_dem_v22_itnord4326_cog512.tif"));
> >> GeneralParameterValue[] generalParameter = // omitting the creation of
> >> GP using the bounds values and resolution
> >> GridCoverage2D coverage2D = reader.read(generalParameter);
> >>
> >> Is the use of generalParameter the right way to address this?
> >>
> >> Thanks for any hint,
> >> Andrea
> >>
> >>
> >> _______________________________________________
> >> GeoTools-GT2-Users mailing list
> >> GeoTools-GT2-Users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to