Ciao Graham, the resample operation uses the warp operation form JAI. The warp operation fills up gaps in the resulting raster with some values which can be controlled via the backgroundValues input parameters. The default value is 0. This means that as an instance if you warp an RGB image the gaps will be filled with balck (0,0,0). If you want to be able to have the gaps transparent the best thing is to change the color model of the input raster to RGBA so taht you'll the gaps automatically set to transparent black.
If my memory serves me right, there is no way to set the backgroundValues via the Resameple operation since it does some automagic computation on categories to get them. Hope that helps, Simone. ------------------------------------------------------- Ing. Simone Giannecchini GeoSolutions S.A.S. Owner - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob: +39 333 8128928 http://www.geo-solutions.it http://simboss.blogspot.com/ http://www.linkedin.com/in/simonegiannecchini ------------------------------------------------------- On Fri, Jan 23, 2009 at 7:17 PM, Graham Davis <[email protected]> wrote: > Hi all, > > I have a question about applying a transparency to a layer or coverage. > Basically I've developed a tool for geo-referencing an image onto a map and > warping it to match the map's CRS. The process for warping the image is to > create a GridCoverage of the image from a derived CRS using a transform, > then use the Operations.resample() method to get the result as a warped > coverage. The result is the image warped to fit the CRS of the map. My > problem is that the edges of the result where it was rotated are black. > > I'm trying to figure out the best way to make these black areas transparent. > Is there a setting that can achieve this when I do the actual resampling? > Or do I need to apply some sort of style/setting on the resulting coverage > afterwards? I don't know how to achieve either or if there is another, > better way. Can someone point me in the right direction? Thanks, > > -- > Graham Davis > Refractions Research Inc. > [email protected] > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel > _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel
