Hello,

when I switched from gt2.2.0 to gt2.3.0, I recognized 2 problems:
1) rendering of my raster data (GridCoverage2D) becomes slower
2) with gt2.2.0 every cell was displayed exactly in the defined color of
my color map, now there is an fading between cells with different values

The first point should be fixed with 2.3.1-SNAPSHOT-rev24168 (Mailing
list discussion of February, 05th).
So first I concentrate on the second point.
I create my ColorMap and MapLayer by the following code:

------------
JMapPane mapPane = ...;
GridCoverage2D grid = ...;
ColorMap colorMap = new ColorMapImpl();
colorMap.setType(ColorMap.TYPE_VALUES);
colorMap.addColorMapEntry(createNewColorMapEntry("",0,Color.RED,1.0));
colorMap.addColorMapEntry(createNewColorMapEntry("",0,Color.BLUE,1.0));
colorMap.addColorMapEntry(createNewColorMapEntry("",0,Color.GREEN,1.0));
colorMap.addColorMapEntry(createNewColorMapEntry("",0,Color.GRAY,1.0));

StyleBuilder builder = new StyleBuilder();
RasterSymbolizer symb =
   builder.createRasterSymbolizer(colorMap,opacity);
Style rasterStyle = builder.createStyle( symb );
mapPane.getContext().addLayer(grid,rasterStyle);
mapPane.setReset(true);
mapPane.repaint();

[...]

public static ColorMapEntry createColorMapEntry(String label, Double
quantity, Color color, double opacity)  {
   ColorMapEntry newEntry = new ColorMapEntryImpl();
   try {
     newEntry.setLabel( label );
     newEntry.setColor( builder.colorExpression( color ) );
     newEntry.setOpacity( builder.literalExpression( opacity ) );
     newEntry.setQuantity( builder.literalExpression( quantity ) );
   } catch (Exception err) {
   }
   return newEntry;
}
------------

First I thought, that another color map type could solve the problem 
(ColorMap.TYPE_VALUES/TYPE_RAMP/TYPE_INTERVALS). But changing the 
setting by colorMap.setType(ColorMap.TYPE_VALUES) had no effect for my 
visualization.

Is there another switch to set, so that I reach "hard" borders between 
cells with different values?

Kind regards...

Martin Schmitz

-------------------------------------------------------------------------
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