Hi,
I'm looking into optimizing the recode function for the case where all keys
and values are literals.
It seems to me the simplest choice is to build a hashmap in the constructor
that maps between keys and values and then use it in the evaluate,
it would be the fastest option available I think.
In case the set of key/values is not made of literals we would fallback
on the current code.
Btw, I see the current code evaluates equality of the key in a case
insensitive
way?
This sounds like different behavior from the spec:
-----------
This function recodes values from a property or expression into
corresponding values of arbitrary type.
The comparisons are performed checking for identical values.
-----------
Given we are in XML land and the spec says "identical" shouldn't we be
assuming
case sensitive behavior by default?
Besides, it's easy for the user to get the case insensitive version, like
this:
<Function name="recode">
<Function name="strToLowerCase">
<PropertyName>KEY_PROPERTY</PropertyName>
</Function>
<ogc:Literal>key1</ogc:Literal>
<ogc:Literal>value1</ogc:Literal>
<ogc:Literal>key2</ogc:Literal>
<ogc:Literal>value2</ogc:Literal>
</Function>
Opinions?
Cheers
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
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
-------------------------------------------------------
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel