Jody Garnett ha scritto:
> Hi Andrea
Hi Jody... you're not cc'ing the ml anymore?
> This was last being worked on by James and I cannot remember how he
> planned to integrate things. I personally assumed they would just be a
> <PropertyName>VAR</PropertyName> where the value was obtained by the
> context rather than by the "current"feature. However he did make a
> seperate subclass for the concept so perhaps they were heading for
> something more explicit: <Env>selectionColor</Env>... We could check
> email / sld 1.0.1 if needed I guess.
I looked around but did not find any trace of context variables... maybe
they have a different name?
> I like your suggestion of a back up value; indeed we could make use of a
> "ENV" function as a temporary measure <Function
> fallbackValue="#FF0000>ENV<Literal>selectionColor</Literal></Function>.
> This has the advantage of being valid and understood by any system.
Oh right, I like this one better. A function with a fallback value..
but then it would need two parameters:
<Function name="enviroment">
<Literal>varName</Literal>
<Literal>#FF0000</Literal>
</Function>
or else have two functions, one that takes just the env var, the other
that takes the env var and a fallback. Or even make fallback its own
function:
<Function name="fallback">
<Function name="enviroment"><Literal>varName</Literal></Function>
<Literal>#FF0000</Literal>
</Function>
Verbose, but more versatile, could be used in other
cases in SLD as well (say the user wants a fallback for an actual
property value)
> If you wanted it may be easier to just borrow the concept of a fallback
> value for the PropertyName tag: <PropertyNme
> fallback="#FF0000>selectionColor</PropertyName>
Yeah... yet the function does not require many changes in the code,
amending the parser, and does not rely on a custom extension... I think
I'll follow that path.
Now, do you have a good suggestion on how to make the function access
the "environment"? Given that we need a thread safe solution, I
was leaning towards a map stored in the thread local. We could
give FilterFunction_Enviroment some static methods to play with
the map so that the actual mechanism is hidden, something like:
FilterFunction_Enviroment.put(String key, Object value);
Object value FilterFunction_Enviroment.get(String key);
Name suggestions? putValue, putEnviroment, ... ?
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel