Hi Michael,
I tried your code at first. But it did't work as well.

Although
MinX = 0, MinY = 0, MaxX = 13184, MaxY = 9933.
Iterator is stoped at x = 13184, y = 3
while trying to perform  iter.setSample(c);
with following error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 52736
        at java.awt.image.DataBufferDouble.setElemFloat(Unknown Source)
        at
javax.media.jai.ComponentSampleModelJAI.setSample(ComponentSampleModelJAI.java:926)
        at
com.sun.media.jai.iterator.WritableRectIterFallback.setSample(WritableRectIterFallback.java:42)
        at 
volumecalculator.spatial.impl.geotools.GridGt2.<init>(GridGt2.java:363)
        at
volumecalculator.spatial.impl.geotools.GridFactoryGt2.createGrid(GridFactoryGt2.java:27)
        at
volumecalculator.VolumeCalculatorAppContext.appInit(VolumeCalculatorAppContext.java:26)

The Tile is 4 pixels high. That is why I thought using tiles will help.



Michael Bedward wrote:
> 
> For example...
> 
> RenderedImage rImg = cov.getRenderedImage();
> TiledImage tImg = new TiledImage(rImg, true);
> WritableRectIter iter = RectIterFactory.createWritable(tImg, null);
> float c = (float)100;
> for (int y = tImg.getMinY(); y <= tImg.getMaxY(); y++) {
>     for (int x = tImg.getMinX(); x <= tImg.getMaxX(); x++) {
>         iter.setSample(c);
>     }
>     iter.nextLine();
>     iter.startPixels();
> }
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/WritableRaster-and-GridCoverageBuilder-tp19690976p19758711.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to