Hello Andrea
andrea antonello a écrit :
> After getting my RenderedOp as result from my operation, this, as I
> expect, is waiting for someone to pull the data out of it.
>
> This happens usually by triggering methods like getWidth, getData, getTile
> etc.
> The rendereop is the result that I want to dump to disk, so I supposed
> that I would trigger rendering only at that point.
>
> Instead, the computation is triggered several times, because I go
> through the process of creating GridCoverage2D from it, which probably
> internally triggers some method that wakes up the operation. Does this
> make sense?
It make sense, the GridCoverage2D constructor may invokes some RenderedImage
that trigs the tile computation. However each tile should be computed only once,
unless there is no TileCache or the TileCache is full.
I would suggest to first make sure that there is a TileCache. The default tile
cache should be used automatically (if I remember well), but as a safety you can
specify it explicitly:
TileCache tc = JAI.getDefaultInstance().getTileCache();
RenderingHints hints = new RenderingHints();
hints.put(JAI.KEY_TILE_CACHE, tc);
and pass those hints to whatever "create" method you use for creating your
image. If you use the standard JAI.create method, it seems to me that the tile
cache hint should be added automatically. But if you instantiate your
PointOpImage directly, you may need to provide the tile cache hints yourself in
your RenderingHint map.
If you really have a TileCache, check if it is full (there is methods in
TileCache interface for checking the amount of bytes used).
Martin
-------------------------------------------------------------------------
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