On Mon, Feb 6, 2012 at 11:03 PM, Blake Crosby <[email protected]> wrote: > Hi All, > > I'm trying to use variable substitution in the SLD to allow the user to > pick which band to display from the raster. > > My SLD Looks like this: > > <RasterSymbolizer> > <Opacity>0.35</Opacity> > <ChannelSelection> > <GrayChannel> > <SourceChannelName> > <ogc:Function name="env"> > <ogc:Literal>band</ogc:Literal> > <ogc:Literal>25</ogc:Literal> > </ogc:Function> > </SourceChannelName> > </GrayChannel> > </ChannelSelection> > .... > > I'm passing the proper query parameter: > > &env=band:20 > > But I get the following error from geoserver: > > Error rendering coverage on the fast path > java.lang.IllegalArgumentException: Band number -1 is not valid. > Band number -1 is not valid. > For input string: "channel" > > So I take it that "function name="env"" doesn't work here as it's > returning -1 or nothing at all?
It's not meant to work there. Variable substition works only in places that accept a OGC Expression, raster symbolizers are not Chers Andrea -- ------------------------------------------------------- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 mob: +39 339 8844549 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ------------------------------------------------------- ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
