Michael Bedward wrote:
> 
> 
> Here's one last suggestion, after which I'm afraid that my feeble
> knowledge of JAI is used up...
> 
> RenderedImage rImg = cov.getRenderedImage();
> TiledImage tImg = new TiledImage(rImg, true);
> WritableRectIter iter = RectIterFactory.createWritable(tImg, null);
> float c = (float)100;
> do {
>     do {
>         iter.setSample(c);
>     } while (!iter.nextPixelDone());
>     iter.startPixels();
> } while (!iter.nextLineDone());
> 
> 
> 
In this way it is possible to write data into GridCiverage and read it, but
it is not possible to write changes to file. It works only with -Xmx1024m
otherwise it can not create DataBuffer while trying to execute
iter.nextLineDone().
However I can live with that.

By the way this solution:

Michael Bedward wrote:
> 
> 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();
> } 
> 

works with WritableRandomIter.

Thanks a lot for your help
Oleg



-- 
View this message in context: 
http://www.nabble.com/WritableRaster-and-GridCoverageBuilder-tp19690976p19775851.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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to