Hello,
I want to create a gridcoverage with 3-banded integer array(false color). My 
data includes nodata values that are greater that actual max value. How to 
create GridCoverage to have the color stretched to min max excluding nodata 
values on rendering? I tried the following code but it doesn't work. The image 
is still dark for the colors are still stretched including the nodata.
Thanks in advance.

Object buff=...//my integer array
 dataType = DataBuffer.TYPE_INT;
WritableRaster raster = RasterFactory.createBandedRaster(dataType,
                width, height, band.length, null);

for (int k = 0; k < band.length; k++) {
            minValues[k] =...;
            maxValues[k] = ...;

for (int y = 0; y < height; y++) {
                for (int x = 0; x < width; x++) {
                   
                       
                        raster.setSample(x, y, k, Array.getInt(buff, y * width
                                + x + k * width * height));
}
}

}

GridCoverageFactory factory = new GridCoverageFactory(null);
GridCoverage2D gc = factory.create(gridname, raster, env, minValues,maxValues, 
null, null, null);


NB: I am using geotools 2.4.

Agossa.
                                          
_________________________________________________________________
Un avatar à votre image ? Créez votre mini-moi !
http://www.ilovemessenger.fr/minimize-me/
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to