On Mon, Jun 30, 2008 at 1:36 PM, Michael Bedward <[EMAIL PROTECTED]> wrote: > Hi all, > > A few days ago I asked about how to implement a coverage defined on a > mathematical function on the users' list. Simone and Martin replied > with info about using JAI's ImageFunction directly or indirectly - > this was a big help. > > Sometime soon I'll have a need for a leaner (in terms of overhead) > approach. I am working on a simulation where entities move within a > landscape, their movements being influenced by local resources, > hazards etc. I want to provide for resource coverages where value is > defined by a mathematical function, the inputs to which may be > position and/or time and/or spatial relationship with features (sens > lat) in other coverages. > > Frequently, resource value will only be queried over a tiny fraction > of the total extent of a coverage. In such cases I'm worried that > there is a large redundant overhead in creating a large image with JAI > to back the coverage.
Mmmmhh. Not sure about this statement. When you create a RenderedImage with an ImageFunction the resulting image will be tiled using the default tile size (512*512). Moreover you can supply a specific TileCache to the operator where you can control the amount of memory you want the resulting rendered image to use. Once tiles get discarded from the TileCache a subsequent request will ask your imagefunction to regenerate the requested tile. Basically, I think you can control quite well the amount of memory your ImageFunction based renderedimage will use, at least imho. > > One approach to this would be a type of coverage based on a > mathematical function (passed to its constructor perhaps). It would > use lazy instantiation so that the function would only be parsed into > some efficiently runnable form (an AST perhaps) when the coverage is > first queried for a value. See above. JAI uses already deferred loading. If yuo design things correctly, tiles will be created using a multithreaded approach only when first requested. TileCache will take care of caching them respecting memory limits. > There would be some facility to create a > backing image for cases where it is known a priori that a large number > of locations will be queried. I would be careful with that. As of now the only thing available in JAI to support in-memory creation/editing is TiledImage which keeps all the tiles in memory. It would not be too hard to design something better but it would not even be too easy. However for your problem, probably TileCache+ImageFunction operator should do the trick. As Martin pointed out there could also be the approach of using renderable images. I have used them only to simulate pyramids, or images backed by formats ecw and mrsid where you can request renderedimages at virtually any resolution (they internally use wavelet compression). When I had to simulate functions with coverage I always used the approach described above but now that I think of it one could use a combination of the two in case you also want fast visualization. Food for more thoughts, I believe... Ciao, Simone. > > Does this sound like it would have any general use ? If so, I would > be happy to being hacking it as an unsupported module - I'll be doing > it for my own app anyway. > > I'd be very grateful for any comments, tips on related work already > happening etc. > > cheers > Michael > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Geotools-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel > -- ------------------------------------------------------- Eng. Simone Giannecchini President /CEO GeoSolutions S.A.S. Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob: +39 333 8128928 http://www.geo-solutions.it ------------------------------------------------------- ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
