Hello,
I also changed to 2.3.0 M0 and got the following raster rendering problem:
---------------
06.10.2006 12:05:33 org.geotools.renderer.lite.StreamingRenderer processStylers
SCHWERWIEGEND: null
java.lang.NullPointerException
at com.vividsolutions.jts.geom.Envelope.init(Envelope.java:254)
at com.vividsolutions.jts.geom.Envelope.<init>(Envelope.java:186)
at
org.geotools.geometry.jts.ReferencedEnvelope.<init>(ReferencedEnvelope.java:112)
at
org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.<init>(GridCoverageRenderer.java:158)
at
org.geotools.renderer.lite.StreamingRenderer.renderRaster(StreamingRenderer.java:1719)
at
org.geotools.renderer.lite.StreamingRenderer.processSymbolizers(StreamingRenderer.java:1580)
at
org.geotools.renderer.lite.StreamingRenderer.process(StreamingRenderer.java:1524)
at
org.geotools.renderer.lite.StreamingRenderer.processStylers(StreamingRenderer.java:1466)
at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:531)
at
org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:395)
at org.geotools.gui.swing.JMapPane.paintComponent(JMapPane.java:414)
---------------
I think this is because JMapPane.paintComponent(.) uses the deprecated method
StreamingRenderer.paint(Graphics2D,Rectangle,Envelope,AffineTransform).
In this method the global variables
- destinationCrs
- mapExtent
- screenSize
- ...
are NOT set, as it is in the new method
StreamingRenderer.paint(Graphics2D,Rectangle,ReferencedEnvelope,AffineTransform).
So in the deeper method StreamingRenderer.renderRaster(..) null is given to the
GridCoverageRenderer-constructor.
I would be very glad to get an solution, because I'm very interested in the
grid recolor operation, too.
And before I make my experiments with GT2.2.0 it would be nice to know, if it
would be easier with GT2.3.0-M0.
Kind regards
Martin
> -----Ursprüngliche Nachricht-----
> Von: "Vanmeulebrouk, Bas" <[EMAIL PROTECTED]>
> Gesendet: 06.10.06 12:25:33
> An: "Jody Garnett" <[EMAIL PROTECTED]>
> CC: [email protected]
> Betreff: Re: [Geotools-gt2-users] Change the colors used to display an
> ArcInfo ASCII Grid
> 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
_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222
-------------------------------------------------------------------------
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