Hi Jon,

Thanks for pointing this out - I'll add a bit to the tutorial.

Meanwhile, one way of creating a style to display a raster is like this...

        StyleFactory factory = CommonFactoryFinder.getStyleFactory(null);
        StyleBuilder sb = new StyleBuilder(factory);
        ColorMap cm = sb.createColorMap( ... );  // see below
        RasterSymbolizer sym = sb.createRasterSymbolizer(cm, 1.0);
        Style style = sb.createStyle(sym);

The colour map for the style can be used to define a ramp of colours,
or a series of intervals with breakpoints, or a set of colours for
specified values.  Which you choose depends on the example data that
you are working with.  Have a look at this page in the javadocs:
http://javadoc.geotools.fr/2.5/org/geotools/styling/StyleBuilder.html#createColorMap(java.lang.String[],%20double[],%20java.awt.Color[],%20int)

Let us know how you go and, if the above was useful, I'll update the tutorial.

cheers
Michael

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to