Hi Jody,
Thank you very much for your reaction. I did try to upgrade to GeoTools
2.3.0 M0, but that causes the following error, in a completely different
part of my application:
Exception in thread "main" java.lang.NoSuchMethodError:
org.opengis.filter.expression.Expression.evaluate(Ljava/lang/Object;)Lja
va/lang/Object;
at
org.geotools.filter.GeometryFilterImpl.getRightGeometry(GeometryFilterIm
pl.java:200)
at
org.geotools.filter.GeometryFilterImpl.validate(GeometryFilterImpl.java:
212)
at
org.geotools.filter.spatial.BBOXImpl.evaluate(BBOXImpl.java:90)
at
org.geotools.filter.AbstractFilter.contains(AbstractFilter.java:64)
at
org.geotools.data.FilteringFeatureReader.hasNext(FilteringFeatureReader.
java:120)
at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRen
derer.java:1461)
at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.jav
a:531)
at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.jav
a:364)
I have found a workaround using GT 2.2.0: I have created a new
GridCoverageReader in which I use a GridSampleDimension to make sure the
colors used to draw the grid are the ones I want.
Kind regards,
Bas.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jody Garnett
Sent: 06 October 2006 09:52
To: Vanmeulebrouk, Bas
Cc: [email protected]
Subject: Re: [Geotools-gt2-users] Change the colors used to display an
ArcInfo ASCII Grid
Raster Symbolizers are supposed to do the trick, if at all possible try
the latest GeoTools 2.3.x release as GridCoverage support has received a
*lot* of attention in terms of quality and performance.
Remember to check the pom.xml file to look for contact information for
the module maintainer as well :-) Jody
>
> 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=DEV
> DEV
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------
-
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=DEVDE
V
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
-------------------------------------------------------------------------
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