From: andrea a. <and...@gm...> - 2010-08-19 10:05:59
|
Quick update. The samplemodel of the image is modified by the styling operation. Ad since b&white map was in MultiPixelPackedSampleModel, it resulted nicely handled (those images are heavily compressed). After the styling the image has a PixelInterleavedSampleModel model, which very probably makes it explode. Hmmm, so for these types of maps, it is better not to play with style. Is there a way to make just a color transparent? Andrea On Thu, Aug 19, 2010 at 9:26 AM, andrea antonello <and...@gm...> wrote: > Hi, > as part of the new raster style editor for udig I am trying to style a > black and white geotiff. > My first test is to just make two ColorMapEntry to change the two main > colors to something else: > > ColorMap colorMap = sf.createColorMap(); > > Color one = Color.green; > Color two = Color.red; > > ColorMapEntry entry = sf.createColorMapEntry(); > entry.setQuantity(ff.literal(0)); > entry.setColor(ff.literal(one)); > entry.setOpacity(ff.literal(1)); > colorMap.addColorMapEntry(entry); > > entry = sf.createColorMapEntry(); > entry.setQuantity(ff.literal(1)); > entry.setColor(ff.literal(two)); > entry.setOpacity(ff.literal(1)); > colorMap.addColorMapEntry(entry); > > rasterSym.setColorMap(colorMap); > > > That would be the same as the non programmatic way add the following to the sld: > > <FeatureTypeStyle> > <Rule> > <RasterSymbolizer> > <ColorMap> > <ColorMapEntry color="#00FF00" quantity="0" /> > <ColorMapEntry color="#FF0000" quantity="1" /> > </ColorMap> > </RasterSymbolizer> > </Rule> > </FeatureTypeStyle> > > > Alright, what happens is that the image that before was reading and > displaying nice, now starts freezing everything as if it was reading > everything and not just the overviews. > > Can anyone with a proper insight give me some advice about how to proceed? > > Also, is there a different way to just alpha a single color in a coverage? > > Thanks, > Andrea > |