On Tue, Nov 23, 2010 at 9:58 AM, v...@csiro <victor....@csiro.au> wrote: > - last resort > * instead of streaming the result out, perhaps I can stream the results to > disk, updated the numberOfFeatures then return it? but this will have impact > on the outputstrategy.
I think there is a solution that can avoid us messing with the output strategy. Take the feature collections and wrap them in a collection that will count and generate the bounds as the encoder streams through it (so you'll have to wrap both the collection and the feature iterator). Then let the encoder write out the xml, but instead of writing it out to the output stream, write it out to a temporary file. Then extract the count and bounds and apply an xslt transformation that will just add the count attribute and the collection bounds element to the result, this time piping the xslt transformation out to the output stream. The transformation should be really easy to write, as it goes to copy all elements, and should be fast, as the only non copy part is targeted to very specific elements (that you'll refer to by absolute xpath). If the admin chose the full buffering output strategy the net result wil be to write the xml on disk twice, but imho, such admin does not care about performance much anyways, so no big deal imho. Cheers Andrea ----------------------------------------------------- Ing. Andrea Aime Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584962313 fax: +39 0584962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ----------------------------------------------------- ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Geoserver-devel mailing list Geoserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-devel