Sounds good to me. A minor suggestion on the name would be something like
"transformString".
On Fri, Apr 18, 2014 at 2:40 AM, Andrea Aime
<[email protected]>wrote:
> On Fri, Apr 18, 2014 at 10:37 AM, Andrea Aime <
> [email protected]> wrote:
>
>> The main use case for this would be to extract bits of complex strings
>> for processing
>> or labeling purposes. Say for example that I have an attribute that is
>> formatted as an ISO
>> string, and I want to extract only the hour portion of it for labeling,
>> the call would be:
>>
>> <ogc:Function name="template">
>> <ogc:Literal>\d{4}-\d{2}-\d{2}T(\d{2}):\d{2}:\d{2}</ogc:Literal>
>> <ogc:Literal>{1}</ogc:Literal>
>> </ogc:Function>
>>
>> or, in CQL terms:
>>
>> template('\d{4}-\d{2}-\d{2}T(\d{2}):\d{2}:\d{2}', {1})
>>
>
> Doh, hit sent and realized I miss an argument, the input string to be
> matched.
> So it would become:
>
> <ogc:Function name="template">
> <ogc:PropertyName>myAttribute</ogc:PropertyName>
> <ogc:Literal>\d{4}-\d{2}-\d{2}T(\d{2}):\d{2}:\d{2}</ogc:Literal>
> <ogc:Literal>{1}</ogc:Literal>
> </ogc:Function>
>
> and in cql:
>
> template(myAttribute, '\d{4}-\d{2}-\d{2}T(\d{2}):\d{2}:\d{2}', {1})
>
> cheers
> Andrea
>
> --
> ==
> Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
> for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> GeoTools-Devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
--
*Justin Deoliveira*
Vice President, Engineering | Boundless
[email protected]
@j_deolive <https://twitter.com/j_deolive>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel