I am trying to process large GeoTIFF images (128 MB) using GeoTIFF reader provided by Geotools library. However the processing time is very high, can anyone suggest how to reduce this time. Normal processing time for this image is 210000 ms, whereas my target is 500 ms.
GdalInfo of the image:
Driver: GTiff/GeoTIFF
Files: /Users/RGBI-7cm.tif
Size is 4000, 4000.
Coordinate System is `'
Metadata:
TIFFTAG_RESOLUTIONUNIT=1 (unitless)
TIFFTAG_XRESOLUTION=1
TIFFTAG_YRESOLUTION=1
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 4000.0)
Upper Right ( 4000.0, 0.0)
Lower Right ( 4000.0, 4000.0)
Center ( 2000.0, 2000.0)
Band 1 Block=4000x1 Type=UInt16, ColorInterp=Red
Mask Flags: PER_DATASET ALPHA
Band 2 Block=4000x1 Type=UInt16, ColorInterp=Green
Mask Flags: PER_DATASET ALPHA
Band 3 Block=4000x1 Type=UInt16, ColorInterp=Blue
Mask Flags: PER_DATASET ALPHA
Band 4 Block=4000x1 Type=UInt16, ColorInterp=Alpha
Code for processing the image in Java:
S3Object s3Object = awsFetchService.fetchObject(cropImageRequest.getAwsS3Bucket(),cropImageRequest.getPrimaryFilePath());
GeoTiffReader reader = new GeoTiffReader(s3Object.getObjectContent());
GridCoverage2D gridCoverage = reader.read(null);