Anaxa Gore a écrit :
> The only thing i do is this :
> 
> Color[][] colors = new Color[][] {{Color.WHITE, color}};
> 
> GridCoverage2D gc = gcf.create("Horizon Coverage", rasterCoverage, 
> this.rasterEnvelope,null,null,null,colors,null);
> 
> I am searching how to create the style !!!
> I want the white (value = 0) to be transparent and the "color" (200) to 
> be in color "color" and to have an opacity of 0.5.

If you work only with GridCoverage2D factory API (not with an object from the 
org.opengis/geotools.style package or a XML document), you can do the following 
(change the category name as you wish). Note, I'm writting from memory; we need 
to check the javadoc for exact API:

Category nodata = new Category("Absence de données", 0, new Color(0,0,0,0));
Category color = new Category("N'importe quoi", 200, new 
Color(100,100,100,128));
Category temperature = new Category("Température", 1, 199, 0.1, 0, new Color[] 
{Color.WHITE, Color.YELLOW, Color.ORANGE, Color.RED});
SampleDimension band = new SampleDimension("Température", new Category[] 
{nodata, color, temperature}, SI.CELSIUS);
GridCoverage2D gc = gcf.create("Horizon", raster, envelope, band);

        Martin

-------------------------------------------------------------------------
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-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to