Martin Tomko a écrit :
> I need to pass around the results of my coverage processing (a 
> Coverage2D, or a geotiff, both are acceptable)  through an XML (as a 
> xsd:base64Binary). The coverages will be VERY small.

It depends what you want to serialize. Raw pixel values, or the image in some 
format (e.g. PNG)?

If you want to serialize raw pixel values, you can get use 
image.getData().getSamples(arectangle) - not really efficient because of the 
copies of pixel values but you get the idea. There is also some alternatives 
also like using JAI iterators or PixelAccesors.

But you are more likely to want to serialize an image in PNG or JPEG format. In 
such case you can use ImageIO.write(...) with a ByteArrayOutputStream.

        Martin

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to