Exception on multi-size mosaic


#1

when I run multi-size mosic with 25 tiles of Sentinel-2 L1C TCI image(about 2.3 GB size), on windows snap desktop with 8GB MEM and 256GB SSD , it show memory error and throw an exception like below, can anyone know how to hold it?


java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.ArrayList.elementData(Unknown Source) at java.util.ArrayList.get(Unknown Source) at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.locateImage(TIFFImageReader.java:472) at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:589) at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.seekToImage(TIFFImageReader.java:576) at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader.getWidth(TIFFImageReader.java:833) at org.esa.s2tbx.dataio.jp2.internal.JP2TileOpImage$ImageReader.getImageWidth(JP2TileOpImage.java:306) at org.esa.s2tbx.dataio.jp2.internal.JP2TileOpImage.computeRectIndirect(JP2TileOpImage.java:166) at org.esa.s2tbx.dataio.jp2.internal.JP2TileOpImage.computeRect(JP2TileOpImage.java:147) at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) Caused: org.esa.snap.core.gpf.OperatorException: -1 at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:376) at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(TranslateIntOpImage.java:132) at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343) at javax.media.jai.PlanarImage.copyExtendedData(PlanarImage.java:2398) at javax.media.jai.PlanarImage.getExtendedData(PlanarImage.java:2459) at com.sun.media.jai.opimage.MosaicOpImage.computeTile(MosaicOpImage.java:432) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at com.sun.media.jai.iterator.RandomIterFallback.makeCurrent(RandomIterFallback.java:108) at com.sun.media.jai.iterator.RandomIterFallback.getSample(RandomIterFallback.java:117) at com.sun.media.jai.opimage.WarpNearestOpImage.computeRectByte(WarpNearestOpImage.java:176) at com.sun.media.jai.opimage.WarpNearestOpImage.computeRect(WarpNearestOpImage.java:99) at javax.media.jai.WarpOpImage.computeTile(WarpOpImage.java:577) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085) at javax.media.jai.RenderedOp.getData(RenderedOp.java:2276) at org.esa.snap.core.image.VirtualBandOpImage.addDataToReferredRasterDataSymbols(VirtualBandOpImage.java:309) at org.esa.snap.core.image.VirtualBandOpImage.computeTile(VirtualBandOpImage.java:235) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:911) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:911) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085) at javax.media.jai.RenderedOp.getData(RenderedOp.java:2276) at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64) at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407) at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393) at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73) at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247) [catch] at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
update:
when I use normal mosic tool to process again, the memory have been >90% used along the process and some seconds it exited with image
detail messages is :
java.lang.ArrayIndexOutOfBoundsException Caused: org.esa.snap.core.gpf.OperatorException at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(OperatorExecutor.java:376) at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at com.sun.media.jai.opimage.TranslateIntOpImage.getTile(TranslateIntOpImage.java:132) at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2343) at javax.media.jai.PlanarImage.copyExtendedData(PlanarImage.java:2398) at javax.media.jai.PlanarImage.getExtendedData(PlanarImage.java:2459) at com.sun.media.jai.opimage.MosaicOpImage.computeTile(MosaicOpImage.java:432) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at com.sun.media.jai.iterator.RandomIterFallback.makeCurrent(RandomIterFallback.java:108) at com.sun.media.jai.iterator.RandomIterFallback.getSample(RandomIterFallback.java:117) at com.sun.media.jai.opimage.WarpNearestOpImage.computeRectByte(WarpNearestOpImage.java:176) at com.sun.media.jai.opimage.WarpNearestOpImage.computeRect(WarpNearestOpImage.java:99) at javax.media.jai.WarpOpImage.computeTile(WarpOpImage.java:577) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085) at javax.media.jai.RenderedOp.getData(RenderedOp.java:2276) at org.esa.snap.core.image.VirtualBandOpImage.addDataToReferredRasterDataSymbols(VirtualBandOpImage.java:309) at org.esa.snap.core.image.VirtualBandOpImage.computeTile(VirtualBandOpImage.java:235) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:911) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PointOpImage.computeTile(PointOpImage.java:911) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085) at javax.media.jai.RenderedOp.getData(RenderedOp.java:2276) at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64) at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407) at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393) at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73) at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137) at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904) at javax.media.jai.OpImage.getTile(OpImage.java:1129) at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247) [catch] at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)


#2

Can you show how you have configured the mosaic?

But probably you don’t need to create a mosaic. Is it correct that you try to mosaic the 25 jp2 files?
Instead, try the MTD_MSI****.xml file.

In addition, 8GB is often not enough to deal handle hi-res data, like S2 MSI. But in your case, the problem does not arise from a memory issue.


#3

Thank you for reply my question, Mr.Marpet.

I used GeoTIFF as output file format and custom WGS-84 CRS.

The most IMPORTANT, I selected ‘Orthorectification’ with ASTER 1-deg GDEM, because the Sentinel-2_User_Handbook did NOT tell me what kind of DEM used for processing Level-1B to Level-1C, SO I want to do orthorectification using DEM of 30 meter resolution.

thanks.:clap:


#4

Have you thought about what happens if you do the orthorectification twice? It is already done for the L1C product and then you do it again. In my opinion this will lead to wrong results.


#5

yeah…What I do really do have a problem…But one more question:
the S2_User_Handbook show that Level-1B product is in sensor geometry and includes the refined geometrical. What refined geometrical mean?Have you done geometric registration such as registration with other reference images? very thankful!


#7

@dorbodwolf

Hi. With regard to your statement:

The most IMPORTANT, I selected ‘Orthorectification’ with ASTER 1-deg GDEM, because the Sentinel-2_User_Handbook did NOT tell me what kind of DEM used for processing Level-1B to Level-1C, SO I want to do orthorectification using DEM of 30 meter resolution.

The DEM is defined in the Definitions section of the Handbook:
https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/definitions

" DEM
Orthorectification in the L1C uses the 90m DEM (PlanetDEM 90). The PlanetDEM 90 is reprocessed from 90 metre SRTM (Shuttle Radar Topography Mission) source data. For PlanetDEM 90 data, the SRTM input data (v4.1) has been improved over specific mountain areas, and corrected over deserts and parts of the USA, using GDEM and NED."

Cheers

Jan

S2 MPC/CC Operations Manager


#8

Thank you for solving my problem, but I can only choose one as Solution. @Jan @marpet