Hi all,

I'm trying to apply a org.geotools.coverage.processing.operation.ZonalStats 
operation to a large Image Mosaic. However, this results in the following 
exception:

java.lang.IllegalArgumentException: Dimensions (width=120960 height=47040) are 
too large
    at java.awt.image.SampleModel.<init>(SampleModel.java:130)
    at java.awt.image.ComponentSampleModel.<init>(ComponentSampleModel.java:146)
    at 
javax.media.jai.ComponentSampleModelJAI.<init>(ComponentSampleModelJAI.java:73)
    at 
javax.media.jai.RasterFactory.createPixelInterleavedSampleModel(RasterFactory.java:946)
    at 
javax.media.jai.RasterFactory.createPixelInterleavedSampleModel(RasterFactory.java:989)
    at 
javax.media.jai.RasterFactory.createComponentSampleModel(RasterFactory.java:1018)
    at 
org.jaitools.media.jai.zonalstats.ZonalStatsRIF.create(ZonalStatsRIF.java:114)
    ... 21 more

This exception is caused by a limitation of java.awt.image.SampleModel:
IllegalArgumentException<http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html>
 - if the product of w and h is greater than Integer.MAX_VALUE

When I look at the code of ZonalStatsOpImage and ZonalStatsRIF, it's not even 
clear whether I really need to create an ImageLayout and a  SampleModel, as the 
layout is marked as being optional in the javadoc. Therefore, I tried removing 
the SampleModel code, and indeed the computation started to run as expected.

So now it runs, but it keeps running, because it is very slow. Does anyone have 
experience with using jai tools on large image mosaics? Is it just a matter of 
improving tile caching in JAI somehow? Would it perhaps be feasible to modify 
the code so that each granule in the mosaic is processed independently?

thanks,

--
Jeroen Dries
TAP - Centre for Remote Sensing and Earth Observation Processes
VITO NV | Boeretang 200 | 2400 Mol
tel. +32 14 33 55 11 | [email protected]<mailto:[email protected]>
[http://www.vito.be/e-maildisclaimer/vito.png]

VITO Disclaimer: http://www.vito.be/e-maildisclaimer
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to