OK, I'm beginning to understand better now - thanks. But there are still some details that I can't fit into place.
Is Function.getFallbackValue() ever used in GeoTools ? I can't quite get my head around when it would be used and a quick grep of the code didn't find much. Sorry to harp on about this but I would really like to reach enlightenment with respect to filter functions and whenever I feel like I'm getting close it all goes hazy again. Michael On 29 April 2011 15:19, Jody Garnett <[email protected]> wrote: > Nope; cause function is the data structure responsible for holding: > - function name > - arguments > - fallback value (if an implementation of the function cannot be found) > Here is the trouble; we should not of really made our function > implementations be the same as the data structure. > Just like we have PropertyAccessor as the "internals" of PropertyName > expression; we should of had some kind of "FunctionExecution" be the > "internals" of a Function expression. > Since we doubled up, each and every one of our Functions needs to be a > proper Function expression (as we will use them during documentation > generation). > So your confusion represent a design failure on our part; just not perhaps > the one you were expecting? > Jody > > On Fri, Apr 29, 2011 at 11:39 AM, Michael Bedward > <[email protected]> wrote: >> >> Thanks Jody. I still don't quite understand. If a fallback value is a >> Literal returned when a function is not implemented on a system, then >> shouldn't it be held somewhere in the code responsible for calling the >> function (e.g. a finder or factory class) rather than the function >> itself ? It seems illogical that the function stores a value that is >> only used when the function itself does not exist. >> >> I should add that I think that part of the SE specification is badly >> written, or at least incomplete, and they don't seem to have thought >> about default values, as opposed to fallback values, at all. >> >> Michael >> >> On 28 April 2011 22:29, Jody Garnett <[email protected]> wrote: >> > Good question :-) >> > I will answer twice and both times be right (don't mind me I am a bit >> > punch >> > drunk from writing docs): >> > A: The fallback value *is* needed in case you are going to encode a >> > document >> > - no sense throwing out information. >> > A: In a related manner you may be constructing a style for use with >> > another >> > system does not implement the function. >> > An easy example is a previous version of a GeoTools; or an >> > environment >> > that does not have some of your custom functions defined. >> > So that scary SE quote is correct, we may not need to use the value at >> > execution time, however it is still of use. >> > And idea occurs to me - we could also use the fallback value when >> > rendering >> > a style "quickly"; ie configure the renderer to not call functions for a >> > quick preview; and then do the full render if the user is >> > interested. The >> > fallback value is always a literal so the resulting style would be >> > "fast". >> > -- >> > Jody Garnett >> > >> > On Thursday, 28 April 2011 at 8:37 PM, Michael Bedward wrote: >> > >> > Hello Jody, >> > >> > Many thanks for this. It looks great. >> > >> > I have a question that is peripheral to the tutorial, and that I know >> > we've gone over in the past: what is the valid use of a fallback value >> > with filter functions ? The Symbology Encoding spec says: >> > >> > "The value of the fallbackValue attribute is used as a default value, >> > if the SE implementation does not support the function. If the >> > implementation supports the function, then the result value is >> > determined by executing the function." >> > >> > In that case, a function shouldn't even have a fallback value field >> > should >> > it ? >> > >> > I remember struggling with this when helping to do the "env" function. >> > If you look at the code for EnvFunction you'll see that a "default" >> > value can be supplied as an optional extra arg to the evaluate method >> > (this was Andrea's suggestion for how to have a default while not >> > violating the spec). If the setFallbackValue is called an warning is >> > logged. >> > >> > Sorry that this is banal feedback on a nice tutorial - but it's so >> > good to have a teaching page about filter functions at last so I think >> > it's worth checking that it's squeaky clean. >> > >> > Michael >> > >> > >> > On 28 April 2011 01:08, Jody Garnett <[email protected]> wrote: >> > >> > Available now: >> > - >> > http://docs.geotools.org/latest/userguide/tutorial/advanced/function.html >> > Review and feedback are of course welcome. >> > -- >> > Jody Garnett >> > -- >> > Jody Garnett >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > WhatsUp Gold - Download Free Network Management Software >> > The most intuitive, comprehensive, and cost-effective network >> > management toolset available today. Delivers lowest initial >> > acquisition cost and overall TCO of any competing solution. >> > http://p.sf.net/sfu/whatsupgold-sd >> > _______________________________________________ >> > Geotools-gt2-users mailing list >> > [email protected] >> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> > >> > > > ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
