johann sorel wrote: >>> What is a problem ? This : >>> lookupExpression.evaluate(object, classType); >>> >>> --> First problem : >>> The lookupExpression have the value "rasterData", >>> This is non sens because a raster is composed of several bands, >>> lookupExpression should have a value like : 1, 2 , 3, 4, 5 ... >> I was just typing in what the specification said; it said to use >> rasterData; I assume after one band has already been selected out via >> a ColorMap entry? I am not sure Johann :-( > 75% of the case we have a single band raster when we want to use the > categorize function. So rasterData is fine. It just looks like they > have forgotten the 25% left. Or perhaps they assume we choose a single > band in the selectedChannel. that's possible too. If that's the case > rasterData is not a mistake and it would solve problem 2 and 3. But > they say nothing about this particular case. In your example it really feels like the source data was in RGB already; I am pretty sure this color map stuff is only intended to produce colors for a single band ...
In keeping with the "just make it work" spirit of Expressions perhaps we should make this work anyways. W can consider the "max" or "average" of the values provided; it would at least make the thing consistent... ie our test works against a single value; they screwed up and gave us three bands; we need to do something. To be honest if we treat this as a "Threshold" making use of "max" is probably for the best... Simone may also be able to provide some light on these kinds of issues? >> Consider the example here: >> - http://schemas.opengis.net/se/1.1.0/example-rastersymbolizer1.xml >> >> It has look up vale = "RasterData" >> and value#00ff00 that is probably the same thing as >> double[]{00,255,00} right? Have a look at the converters api; and >> send email ... chances are that you need to make the lookup here >> return a Color in both cases... > I know it, nearly the 20th time I check it if I had made a mistake. Okay so I have a converter written that can make a Color out of a number; and a color out of a String; but this is the first time I have seen an array of doubles; so let's handle that one as well. The feature model (the only code in geotools that usually uses this stuff) does not allow arrays; so you are the first person to have this problem. Oh wait I was looking at the wrong thing .... looking at the array of doubles and trying to make it into a Color; We need to look at the Threshold ...) > <RasterSymbolizer version="1.1.0" > xsi:schemaLocation="http://www.opengis.net/se/1.1.0/Symbolizer.xsd"> > <Opacity>1.0</Opacity> > <OverlapBehavior>AVERAGE</OverlapBehavior> > - > <ColorMap> > - > <Categorize fallbackValue="#78c818"> > <LookupValue>Rasterdata</LookupValue> > <Value>#00ff00</Value> > <Threshold>-417</Threshold> > <Value>#00fa00</Value> Can we make an educated guess based on the <OverlapBehavior>AVERAGE</OverlapBehavior> - ie does this imply we should take the average of the RGB values and use that when look at our RasterData? Jody > I'll be on IRC meeting this evening. That is great! we will sort it out (perhaps after the meeting?). ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel