Well one evil thing to do would be to scan through once and collect the feature ids (perhaps you could do that efficiently?); and then make a collection that produces an iterator that fetches the matching feature for each feature id in turn?

Not the best idea; but something.

The problem with that would be performance again.

But I'm looking at something now that might work. Textmarker actually has its own Iterator model, and what I am doing is implementing that one, which wraps a FeatureIterator and automatically closes after the last read. Something like this:

|public TemplateModel next() throws TemplateModelException {
        if (!hasNext) {
            return null;
        }
        Object o = iterator.next();
        hasNext = iterator.hasNext();
        if (!hasNext) {
            iterator.close();
        }
        return new BeanModel(o, wrapper);
    }|

--
*Niels Charlier*

Software Engineer
CSIRO Earth Science and Resource Engineering
Phone: +61 8 6436 8914

Australian Resources Research Centre
26 Dick Perry Avenue, Kensington WA 6151
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to