Title: Change the colors used to display an ArcInfo ASCII Grid

Hi list,

I am trying to change the colors used to display an ArcInfo ASCII Grid. I create a style using the code below. However, no matter what values I use for the labels, quantities and colors arrays, the grid is displayed in red, green and blue. Does anyone know how the values in the grid can be mapped to a color?

We are using GeoTools 2.2.0.

Kind regards,

Bas Vanmeulebrouk.

private Style CreateRasterStyle() {
        /*
         * Create a Style to display the Grid
         */
        StyleBuilder stylebuilder = new StyleBuilder();
       
        String[] labels = new String[] {"a", "b", "c", "d", "e"};
        double[] quantities = new double[] {100, 200, 300, 400, 500};
        Color[] colors = new Color[] {new Color(0, 255, 0), new Color(255, 255, 0),
                        new Color(255, 127, 0), new Color(191, 127, 63),
                        new Color(255, 255, 255)};
               
               
        ColorMap cm = stylebuilder.createColorMap(labels, quantities, colors, ColorMap.TYPE_VALUES);
        RasterSymbolizer rastersymbolizer = stylebuilder.createRasterSymbolizer(cm, 1);
        return stylebuilder.createStyle(rastersymbolizer);
}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to