Re: [Geotools-devel] New filter functions for arrays

2020-05-06 Thread Mauro Bartolomeoli
Thanks to you for all the useful advices.
Everything has been merged on master.

Il giorno mar 5 mag 2020 alle ore 09:18 Jody Garnett 
ha scritto:

> Just caught up on these PRS, that worked out great Mauro - excellent :)
> - https://github.com/geotools/geotools/pull/2909
> - https://github.com/geotools/geotools/pull/2914
> --
> Jody Garnett
>
>
> On Thu, 30 Apr 2020 at 18:06, Jody Garnett  wrote:
>
>> Thanks, I reviewed, and then came up with an idea half way through...
>>
>> I think it would be far easier to maintain if your function creates a
>> EqualsToImpl instance internally and uses it to determine true/false. this
>> way no logic is duplicated and matchAction is already handled?
>> --
>> Jody Garnett
>>
>>
>> On Thu, 30 Apr 2020 at 09:44, Mauro Bartolomeoli <
>> mauro.bartolome...@geo-solutions.it> wrote:
>>
>>> Hi Jody and all,
>>> the first step of this work has been transformed into a pull request
>>> here: https://github.com/geotools/geotools/pull/2909
>>> This is about adding the matchAction optional parameter to the equalTo
>>> filter function.
>>>
>>> I will follow up with another one about array creation.
>>>
>>>
>>> Il giorno mer 29 apr 2020 alle ore 10:37 Mauro Bartolomeoli <
>>> mauro.bartolome...@geo-solutions.it> ha scritto:
>>>
 Hi Jody,

>
>- Compare FilterFunction_strConcat
>
> 
>  (fixed)
>vs ConcatenateFunction
>
> 
> (variable)
>- Concatinate
>
> 
>  where
>a variable number of table elements are supplied, and an optional last
>parameter is used.
>NAME = new FunctionNameImpl("Interpolate", lookup, table, mode,
>
>
 Got it! I tried adding an optional matchAction parameter to the
 existing equalTo, and I think we can go for that option.

 --
>>>
>>> Regards,
>>>
>>> Mauro Bartolomeoli
>>>
>>> ==
>>> GeoServer Professional Services from the experts! Visit
>>> http://goo.gl/it488V for more information.
>>> ==
>>>
>>> Dott. Mauro Bartolomeoli
>>> @mauro_bart
>>> Technical Lead
>>>
>>> GeoSolutions S.A.S.
>>> Via di Montramito 3/A
>>> 55054  Massarosa (LU)
>>> Italy
>>>
>>> mobile: +39 393 904 1756
>>> phone: +39 0584 962313
>>> fax:  +39 0584 1660272
>>>
>>> http://www.geo-solutions.it
>>> http://twitter.com/geosolutions_it
>>>
>>> ---
>>>
>>> Con riferimento alla normativa sul trattamento dei dati personali (Reg.
>>> UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
>>> precisa che ogni circostanza inerente alla presente email (il suo
>>> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
>>> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
>>> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
>>> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>>>
>>> This email is intended only for the person or entity to which it is
>>> addressed and may contain information that is privileged, confidential or
>>> otherwise protected from disclosure. We remind that - as provided by
>>> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
>>> e-mail or the information herein by anyone other than the intended
>>> recipient is prohibited. If you have received this email by mistake, please
>>> notify us immediately by telephone or e-mail.
>>>
>>

-- 

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:  +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from discl

Re: [Geotools-devel] New filter functions for arrays

2020-05-05 Thread Jody Garnett
Just caught up on these PRS, that worked out great Mauro - excellent :)
- https://github.com/geotools/geotools/pull/2909
- https://github.com/geotools/geotools/pull/2914
--
Jody Garnett


On Thu, 30 Apr 2020 at 18:06, Jody Garnett  wrote:

> Thanks, I reviewed, and then came up with an idea half way through...
>
> I think it would be far easier to maintain if your function creates a
> EqualsToImpl instance internally and uses it to determine true/false. this
> way no logic is duplicated and matchAction is already handled?
> --
> Jody Garnett
>
>
> On Thu, 30 Apr 2020 at 09:44, Mauro Bartolomeoli <
> mauro.bartolome...@geo-solutions.it> wrote:
>
>> Hi Jody and all,
>> the first step of this work has been transformed into a pull request
>> here: https://github.com/geotools/geotools/pull/2909
>> This is about adding the matchAction optional parameter to the equalTo
>> filter function.
>>
>> I will follow up with another one about array creation.
>>
>>
>> Il giorno mer 29 apr 2020 alle ore 10:37 Mauro Bartolomeoli <
>> mauro.bartolome...@geo-solutions.it> ha scritto:
>>
>>> Hi Jody,
>>>

- Compare FilterFunction_strConcat

 
  (fixed)
vs ConcatenateFunction

 
 (variable)
- Concatinate

 
  where
a variable number of table elements are supplied, and an optional last
parameter is used.
NAME = new FunctionNameImpl("Interpolate", lookup, table, mode,


>>> Got it! I tried adding an optional matchAction parameter to the existing
>>> equalTo, and I think we can go for that option.
>>>
>>> --
>>
>> Regards,
>>
>> Mauro Bartolomeoli
>>
>> ==
>> GeoServer Professional Services from the experts! Visit
>> http://goo.gl/it488V for more information.
>> ==
>>
>> Dott. Mauro Bartolomeoli
>> @mauro_bart
>> Technical Lead
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054  Massarosa (LU)
>> Italy
>>
>> mobile: +39 393 904 1756
>> phone: +39 0584 962313
>> fax:  +39 0584 1660272
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> ---
>>
>> Con riferimento alla normativa sul trattamento dei dati personali (Reg.
>> UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
>> precisa che ogni circostanza inerente alla presente email (il suo
>> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
>> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
>> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
>> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>>
>> This email is intended only for the person or entity to which it is
>> addressed and may contain information that is privileged, confidential or
>> otherwise protected from disclosure. We remind that - as provided by
>> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
>> e-mail or the information herein by anyone other than the intended
>> recipient is prohibited. If you have received this email by mistake, please
>> notify us immediately by telephone or e-mail.
>>
>
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-30 Thread Jody Garnett
Thanks, I reviewed, and then came up with an idea half way through...

I think it would be far easier to maintain if your function creates a
EqualsToImpl instance internally and uses it to determine true/false. this
way no logic is duplicated and matchAction is already handled?
--
Jody Garnett


On Thu, 30 Apr 2020 at 09:44, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi Jody and all,
> the first step of this work has been transformed into a pull request here:
> https://github.com/geotools/geotools/pull/2909
> This is about adding the matchAction optional parameter to the equalTo
> filter function.
>
> I will follow up with another one about array creation.
>
>
> Il giorno mer 29 apr 2020 alle ore 10:37 Mauro Bartolomeoli <
> mauro.bartolome...@geo-solutions.it> ha scritto:
>
>> Hi Jody,
>>
>>>
>>>- Compare FilterFunction_strConcat
>>>
>>> 
>>>  (fixed)
>>>vs ConcatenateFunction
>>>
>>> 
>>> (variable)
>>>- Concatinate
>>>
>>> 
>>>  where
>>>a variable number of table elements are supplied, and an optional last
>>>parameter is used.
>>>NAME = new FunctionNameImpl("Interpolate", lookup, table, mode,
>>>
>>>
>> Got it! I tried adding an optional matchAction parameter to the existing
>> equalTo, and I think we can go for that option.
>>
>> --
>
> Regards,
>
> Mauro Bartolomeoli
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
>
> mobile: +39 393 904 1756
> phone: +39 0584 962313
> fax:  +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>
> This email is intended only for the person or entity to which it is
> addressed and may contain information that is privileged, confidential or
> otherwise protected from disclosure. We remind that - as provided by
> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
> e-mail or the information herein by anyone other than the intended
> recipient is prohibited. If you have received this email by mistake, please
> notify us immediately by telephone or e-mail.
>
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-30 Thread Mauro Bartolomeoli
Hi Jody and all,
the first step of this work has been transformed into a pull request here:
https://github.com/geotools/geotools/pull/2909
This is about adding the matchAction optional parameter to the equalTo
filter function.

I will follow up with another one about array creation.


Il giorno mer 29 apr 2020 alle ore 10:37 Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> ha scritto:

> Hi Jody,
>
>>
>>- Compare FilterFunction_strConcat
>>
>> 
>>  (fixed)
>>vs ConcatenateFunction
>>
>> 
>> (variable)
>>- Concatinate
>>
>> 
>>  where
>>a variable number of table elements are supplied, and an optional last
>>parameter is used.
>>NAME = new FunctionNameImpl("Interpolate", lookup, table, mode,
>>
>>
> Got it! I tried adding an optional matchAction parameter to the existing
> equalTo, and I think we can go for that option.
>
> --

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:  +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-29 Thread Mauro Bartolomeoli
Hi Jody,

>
>- Compare FilterFunction_strConcat
>
> 
>  (fixed)
>vs ConcatenateFunction
>
> 
> (variable)
>- Concatinate
>
> 
>  where
>a variable number of table elements are supplied, and an optional last
>parameter is used.
>NAME = new FunctionNameImpl("Interpolate", lookup, table, mode,
>
>
Got it! I tried adding an optional matchAction parameter to the existing
equalTo, and I think we can go for that option.
I will get back when I have something news for the array creation stuff.
I would open two distinct JIRAs, so that I can work on them independently.

Mauro

-- 

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:  +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-29 Thread Jody Garnett
Functions can have optional parameters, or indeed a variable number of
parameters.

   - Compare FilterFunction_strConcat
   

(fixed)
   vs ConcatenateFunction
   

(variable)
   - Concatinate
   

where
   a variable number of table elements are supplied, and an optional last
   parameter is used.
   NAME = new FunctionNameImpl("Interpolate", lookup, table, mode,

--
Jody Garnett


On Tue, 28 Apr 2020 at 23:54, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi Jody,
>
>
> Il giorno ven 24 apr 2020 alle ore 22:14 Jody Garnett <
> jody.garn...@gmail.com> ha scritto:
>
>> Thanks for the good discussion, I still think I like equalsTo( value,
>> value, matchPolicy) just so there are less concepts around. If you really
>> do not like it can you do equalToMultipe( value, value, matchAction) so the
>> sort order works out closer :)
>>
>
> equalTo already exists, so I went for a similar, but different name.
> equalToMultiple is fine too.
> I have a question here: from what I understood filter functions need to
> have a fixed set of parameters, so I cannot simply reuse equalTo and add an
> optional argument to it. Is this correct?
>
>
>>
>> Also. please do not name the class FilterFunction_equalToMultiple <--
>> this "FilterFunction_" prefix is the result of an old code generator David
>> Blasby wrote and I have never been able to get folks to copy copying the
>> pattern.
>>
>
> Oh, I didn't know about that, I will rename stuff properly.
>
> --
>
> Regards,
>
> Mauro Bartolomeoli
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
>
> mobile: +39 393 904 1756
> phone: +39 0584 962313
> fax:  +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>
> This email is intended only for the person or entity to which it is
> addressed and may contain information that is privileged, confidential or
> otherwise protected from disclosure. We remind that - as provided by
> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
> e-mail or the information herein by anyone other than the intended
> recipient is prohibited. If you have received this email by mistake, please
> notify us immediately by telephone or e-mail.
>
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-28 Thread Mauro Bartolomeoli
Hi Jody,


Il giorno ven 24 apr 2020 alle ore 22:14 Jody Garnett <
jody.garn...@gmail.com> ha scritto:

> Thanks for the good discussion, I still think I like equalsTo( value,
> value, matchPolicy) just so there are less concepts around. If you really
> do not like it can you do equalToMultipe( value, value, matchAction) so the
> sort order works out closer :)
>

equalTo already exists, so I went for a similar, but different name.
equalToMultiple is fine too.
I have a question here: from what I understood filter functions need to
have a fixed set of parameters, so I cannot simply reuse equalTo and add an
optional argument to it. Is this correct?


>
> Also. please do not name the class FilterFunction_equalToMultiple <-- this
> "FilterFunction_" prefix is the result of an old code generator David
> Blasby wrote and I have never been able to get folks to copy copying the
> pattern.
>

Oh, I didn't know about that, I will rename stuff properly.

-- 

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:  +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-24 Thread Jody Garnett
I would like to go over my earlier answer of split( string, delimiter )
since it was my answer on how to handle arrays.

*I am sorry the design of Filter and Converters is so "brittle" and hard to
communicate clearly. Each function implementation has to use the evaluate
methods correctly, and developers need to add additional converters over
time, for the architecture to work out as planned.*

It would help if I had an example of where you needed an array of integers,
I am going to assume Stroke stroke-dasharray just to talk it through.

It is up to the code evaluating the expression to call:

Integer[] array = (int[]) expression.evaluate( feature, Integer[].class );


The above looks easy, what do we need to do to make this happen?

CQL: split( "2 2", " ")

This:

1. Evaluates to a String[]
2. ArrayConverterFactory should be able to convert String[] to the
requested Integer[]

Reading the code of ArrayConverterFactory

shows
that:
a) Incomplete (only providing SingleToArrayConverter
and ArrayToSingleConverter)
b) Does not provide a a converter for element by element conversion
c) Written by me (sigh)

This factory should make a ArrayConverter instance covering a few more
cases:

1. Be willing to traverse the array (right now it just does a single value)
2. Make use of Converters to convert each element if needed to the target
element type.
3. Converters in this example would delegate to NumericConverterFactory

(and NumericConverter)
converting each element from String to Integer

-- split vs array --

I would make the second parameter optional and default to "\w" whitespace.
Not sure if you want to offer a regex or just a simple split?
CQL: split( "1 2 3" )
CQL: split( "1 2 3", " ")
CQL: split( "1 2 3", "\w")

An array( ... ) or list function would also be fine, just be sure to allow
min occurs 0 / max occurs 1 on the element parameter:

CQL: array()
CQL: array(1, 1.0, "1", "1.2")

The above would work just fine and convert to an Integer[] if requested.

-- primitives --

Because Java primates are a pain:

Integer[] array = (int[]) expression.evaluate( feature, Integer[].class );
int[] array = ArrayUtils.toPrimitive( array );


That strikes me as boilerplate code, too easy to make a mistake. To address
we would need a PrimitiveArrayConverter so that the following would work:

int[] array = (int[]) expression.evaluate( feature, int[].class );


 --
Jody Garnett


On Fri, 24 Apr 2020 at 06:52, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi Jody and all,
> I did a little bit more of investigation, and I replaced arrayOverlap with
> a more generic FilterFunction_multipleEqualTo (better names are welcome)
> that is like FilterFunction_equalTo with an additional parameter to specify
> the MatchAction (ANY, ONE or ALL).
> Still open the reasoning on how to express array literals in ECQL. For my
> own use case I can move the arrayFromString function in my project code,
> but I think a more general solution to this problem could be useful to have
> in GeoTools.
>
> Il giorno ven 24 apr 2020 alle ore 09:01 Mauro Bartolomeoli <
> mauro.bartolome...@geo-solutions.it> ha scritto:
>
>> Hi Jody,
>>
>>
>> Il giorno gio 23 apr 2020 alle ore 19:44 Jody Garnett <
>> jody.garn...@gmail.com> ha scritto:
>>
>>> Filter is not typed, seeing types in the function name read more like
>>> java and less like CQL.
>>>
>>> *split( string, delimiter )*
>>>
>>>
>>> For the same reason I do not want to see parameters like
>>> 'java.lang.Integer' used when Filter environment is untyped. If you do need
>>> an int[] from an expression, make sure Converters handles it appropriately
>>> so the work is done once. It is bad enough we have functions like int2bbool
>>> and int2double as there should not be a need for it.
>>>
>>
>> I understand your concern, and I try to express my underlying need, so
>> that we can identify the best solution, What I miss in (E)CQL right now is
>> a way to express array literals. The proposal above was indeed about being
>> able to create an array of numbers. Do you have any alternative idea on how
>> we can do that?
>>
>>
>>> I am not sure what to make of array overlaps function:
>>> - I see the name conflict with overlaps(geom,geom) function
>>> - We already have equals with matchAction Any to handle this
>>> functionality, is there any reason why you need it to be a function and not
>>> a filter?
>>> - There are examples where filters have been repurposed as functions
>>> already, for example the equalTo(a,b): Boolean function. I would follow
>>> that example.
>>>
>>> equalTo( value, value, matchPolicy ) - where matchPolicy is "All", "Any"
>>> or "One"
>>>
>>>
>> After reading this, I had a look at the postgis driver co

Re: [Geotools-devel] New filter functions for arrays

2020-04-24 Thread Jody Garnett
Thanks for the good discussion, I still think I like equalsTo( value,
value, matchPolicy) just so there are less concepts around. If you really
do not like it can you do equalToMultipe( value, value, matchAction) so the
sort order works out closer :)

Also. please do not name the class FilterFunction_equalToMultiple <-- this
"FilterFunction_" prefix is the result of an old code generator David
Blasby wrote and I have never been able to get folks to copy copying the
pattern.
--
Jody Garnett


On Fri, 24 Apr 2020 at 06:52, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi Jody and all,
> I did a little bit more of investigation, and I replaced arrayOverlap with
> a more generic FilterFunction_multipleEqualTo (better names are welcome)
> that is like FilterFunction_equalTo with an additional parameter to specify
> the MatchAction (ANY, ONE or ALL).
> Still open the reasoning on how to express array literals in ECQL. For my
> own use case I can move the arrayFromString function in my project code,
> but I think a more general solution to this problem could be useful to have
> in GeoTools.
>
> Il giorno ven 24 apr 2020 alle ore 09:01 Mauro Bartolomeoli <
> mauro.bartolome...@geo-solutions.it> ha scritto:
>
>> Hi Jody,
>>
>>
>> Il giorno gio 23 apr 2020 alle ore 19:44 Jody Garnett <
>> jody.garn...@gmail.com> ha scritto:
>>
>>> Filter is not typed, seeing types in the function name read more like
>>> java and less like CQL.
>>>
>>> *split( string, delimiter )*
>>>
>>>
>>> For the same reason I do not want to see parameters like
>>> 'java.lang.Integer' used when Filter environment is untyped. If you do need
>>> an int[] from an expression, make sure Converters handles it appropriately
>>> so the work is done once. It is bad enough we have functions like int2bbool
>>> and int2double as there should not be a need for it.
>>>
>>
>> I understand your concern, and I try to express my underlying need, so
>> that we can identify the best solution, What I miss in (E)CQL right now is
>> a way to express array literals. The proposal above was indeed about being
>> able to create an array of numbers. Do you have any alternative idea on how
>> we can do that?
>>
>>
>>> I am not sure what to make of array overlaps function:
>>> - I see the name conflict with overlaps(geom,geom) function
>>> - We already have equals with matchAction Any to handle this
>>> functionality, is there any reason why you need it to be a function and not
>>> a filter?
>>> - There are examples where filters have been repurposed as functions
>>> already, for example the equalTo(a,b): Boolean function. I would follow
>>> that example.
>>>
>>> equalTo( value, value, matchPolicy ) - where matchPolicy is "All", "Any"
>>> or "One"
>>>
>>>
>> After reading this, I had a look at the postgis driver code to handle
>> array comparisons, and maybe I can make it work using equalTo. Going to try
>> and let you know.
>> Thanks for your suggestions.
>>
>> --
>>
>> Regards,
>>
>> Mauro Bartolomeoli
>>
>> ==
>> GeoServer Professional Services from the experts! Visit
>> http://goo.gl/it488V for more information.
>> ==
>>
>> Dott. Mauro Bartolomeoli
>> @mauro_bart
>> Technical Lead
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054  Massarosa (LU)
>> Italy
>>
>> mobile: +39 393 904 1756
>> phone: +39 0584 962313
>> fax:  +39 0584 1660272
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> ---
>>
>> Con riferimento alla normativa sul trattamento dei dati personali (Reg.
>> UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
>> precisa che ogni circostanza inerente alla presente email (il suo
>> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
>> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
>> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
>> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>>
>> This email is intended only for the person or entity to which it is
>> addressed and may contain information that is privileged, confidential or
>> otherwise protected from disclosure. We remind that - as provided by
>> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
>> e-mail or the information herein by anyone other than the intended
>> recipient is prohibited. If you have received this email by mistake, please
>> notify us immediately by telephone or e-mail.
>>
>
>
> --
>
> Regards,
>
> Mauro Bartolomeoli
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
>
> mobile: +39 393 904 1756
> phone: +39 0584 962313
> fax:  +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> --

Re: [Geotools-devel] New filter functions for arrays

2020-04-24 Thread Ian Turton
Does ECQL use `[` `]` for anything currently - could we hack the grammar to
support [1,2,3] as an array?

Ian

On Fri, 24 Apr 2020 at 14:53, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi Jody and all,
> I did a little bit more of investigation, and I replaced arrayOverlap with
> a more generic FilterFunction_multipleEqualTo (better names are welcome)
> that is like FilterFunction_equalTo with an additional parameter to specify
> the MatchAction (ANY, ONE or ALL).
> Still open the reasoning on how to express array literals in ECQL. For my
> own use case I can move the arrayFromString function in my project code,
> but I think a more general solution to this problem could be useful to have
> in GeoTools.
>
> Il giorno ven 24 apr 2020 alle ore 09:01 Mauro Bartolomeoli <
> mauro.bartolome...@geo-solutions.it> ha scritto:
>
>> Hi Jody,
>>
>>
>> Il giorno gio 23 apr 2020 alle ore 19:44 Jody Garnett <
>> jody.garn...@gmail.com> ha scritto:
>>
>>> Filter is not typed, seeing types in the function name read more like
>>> java and less like CQL.
>>>
>>> *split( string, delimiter )*
>>>
>>>
>>> For the same reason I do not want to see parameters like
>>> 'java.lang.Integer' used when Filter environment is untyped. If you do need
>>> an int[] from an expression, make sure Converters handles it appropriately
>>> so the work is done once. It is bad enough we have functions like int2bbool
>>> and int2double as there should not be a need for it.
>>>
>>
>> I understand your concern, and I try to express my underlying need, so
>> that we can identify the best solution, What I miss in (E)CQL right now is
>> a way to express array literals. The proposal above was indeed about being
>> able to create an array of numbers. Do you have any alternative idea on how
>> we can do that?
>>
>>
>>> I am not sure what to make of array overlaps function:
>>> - I see the name conflict with overlaps(geom,geom) function
>>> - We already have equals with matchAction Any to handle this
>>> functionality, is there any reason why you need it to be a function and not
>>> a filter?
>>> - There are examples where filters have been repurposed as functions
>>> already, for example the equalTo(a,b): Boolean function. I would follow
>>> that example.
>>>
>>> equalTo( value, value, matchPolicy ) - where matchPolicy is "All", "Any"
>>> or "One"
>>>
>>>
>> After reading this, I had a look at the postgis driver code to handle
>> array comparisons, and maybe I can make it work using equalTo. Going to try
>> and let you know.
>> Thanks for your suggestions.
>>
>> --
>>
>> Regards,
>>
>> Mauro Bartolomeoli
>>
>> ==
>> GeoServer Professional Services from the experts! Visit
>> http://goo.gl/it488V for more information.
>> ==
>>
>> Dott. Mauro Bartolomeoli
>> @mauro_bart
>> Technical Lead
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054  Massarosa (LU)
>> Italy
>>
>> mobile: +39 393 904 1756
>> phone: +39 0584 962313
>> fax:  +39 0584 1660272
>>
>> http://www.geo-solutions.it
>> http://twitter.com/geosolutions_it
>>
>> ---
>>
>> Con riferimento alla normativa sul trattamento dei dati personali (Reg.
>> UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
>> precisa che ogni circostanza inerente alla presente email (il suo
>> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
>> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
>> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
>> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>>
>> This email is intended only for the person or entity to which it is
>> addressed and may contain information that is privileged, confidential or
>> otherwise protected from disclosure. We remind that - as provided by
>> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
>> e-mail or the information herein by anyone other than the intended
>> recipient is prohibited. If you have received this email by mistake, please
>> notify us immediately by telephone or e-mail.
>>
>
>
> --
>
> Regards,
>
> Mauro Bartolomeoli
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
>
> mobile: +39 393 904 1756
> phone: +39 0584 962313
> fax:  +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo sc

Re: [Geotools-devel] New filter functions for arrays

2020-04-24 Thread Mauro Bartolomeoli
Hi Jody and all,
I did a little bit more of investigation, and I replaced arrayOverlap with
a more generic FilterFunction_multipleEqualTo (better names are welcome)
that is like FilterFunction_equalTo with an additional parameter to specify
the MatchAction (ANY, ONE or ALL).
Still open the reasoning on how to express array literals in ECQL. For my
own use case I can move the arrayFromString function in my project code,
but I think a more general solution to this problem could be useful to have
in GeoTools.

Il giorno ven 24 apr 2020 alle ore 09:01 Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> ha scritto:

> Hi Jody,
>
>
> Il giorno gio 23 apr 2020 alle ore 19:44 Jody Garnett <
> jody.garn...@gmail.com> ha scritto:
>
>> Filter is not typed, seeing types in the function name read more like
>> java and less like CQL.
>>
>> *split( string, delimiter )*
>>
>>
>> For the same reason I do not want to see parameters like
>> 'java.lang.Integer' used when Filter environment is untyped. If you do need
>> an int[] from an expression, make sure Converters handles it appropriately
>> so the work is done once. It is bad enough we have functions like int2bbool
>> and int2double as there should not be a need for it.
>>
>
> I understand your concern, and I try to express my underlying need, so
> that we can identify the best solution, What I miss in (E)CQL right now is
> a way to express array literals. The proposal above was indeed about being
> able to create an array of numbers. Do you have any alternative idea on how
> we can do that?
>
>
>> I am not sure what to make of array overlaps function:
>> - I see the name conflict with overlaps(geom,geom) function
>> - We already have equals with matchAction Any to handle this
>> functionality, is there any reason why you need it to be a function and not
>> a filter?
>> - There are examples where filters have been repurposed as functions
>> already, for example the equalTo(a,b): Boolean function. I would follow
>> that example.
>>
>> equalTo( value, value, matchPolicy ) - where matchPolicy is "All", "Any"
>> or "One"
>>
>>
> After reading this, I had a look at the postgis driver code to handle
> array comparisons, and maybe I can make it work using equalTo. Going to try
> and let you know.
> Thanks for your suggestions.
>
> --
>
> Regards,
>
> Mauro Bartolomeoli
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
>
> mobile: +39 393 904 1756
> phone: +39 0584 962313
> fax:  +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>
> This email is intended only for the person or entity to which it is
> addressed and may contain information that is privileged, confidential or
> otherwise protected from disclosure. We remind that - as provided by
> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
> e-mail or the information herein by anyone other than the intended
> recipient is prohibited. If you have received this email by mistake, please
> notify us immediately by telephone or e-mail.
>


-- 

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:  +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
Europea

Re: [Geotools-devel] New filter functions for arrays

2020-04-24 Thread Mauro Bartolomeoli
Hi Jody,


Il giorno gio 23 apr 2020 alle ore 19:44 Jody Garnett <
jody.garn...@gmail.com> ha scritto:

> Filter is not typed, seeing types in the function name read more like java
> and less like CQL.
>
> *split( string, delimiter )*
>
>
> For the same reason I do not want to see parameters like
> 'java.lang.Integer' used when Filter environment is untyped. If you do need
> an int[] from an expression, make sure Converters handles it appropriately
> so the work is done once. It is bad enough we have functions like int2bbool
> and int2double as there should not be a need for it.
>

I understand your concern, and I try to express my underlying need, so that
we can identify the best solution, What I miss in (E)CQL right now is a way
to express array literals. The proposal above was indeed about being able
to create an array of numbers. Do you have any alternative idea on how we
can do that?


> I am not sure what to make of array overlaps function:
> - I see the name conflict with overlaps(geom,geom) function
> - We already have equals with matchAction Any to handle this
> functionality, is there any reason why you need it to be a function and not
> a filter?
> - There are examples where filters have been repurposed as functions
> already, for example the equalTo(a,b): Boolean function. I would follow
> that example.
>
> equalTo( value, value, matchPolicy ) - where matchPolicy is "All", "Any"
> or "One"
>
>
After reading this, I had a look at the postgis driver code to handle array
comparisons, and maybe I can make it work using equalTo. Going to try and
let you know.
Thanks for your suggestions.

-- 

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:  +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

---

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
precisa che ogni circostanza inerente alla presente email (il suo
contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. We remind that - as provided by
European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
e-mail or the information herein by anyone other than the intended
recipient is prohibited. If you have received this email by mistake, please
notify us immediately by telephone or e-mail.
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel


Re: [Geotools-devel] New filter functions for arrays

2020-04-23 Thread Jody Garnett
Filter is not typed, seeing types in the function name read more like java
and less like CQL.

*split( string, delimiter )*


For the same reason I do not want to see parameters like
'java.lang.Integer' used when Filter environment is untyped. If you do need
an int[] from an expression, make sure Converters handles it appropriately
so the work is done once. It is bad enough we have functions like int2bbool
and int2double as there should not be a need for it.


I am not sure what to make of array overlaps function:
- I see the name conflict with overlaps(geom,geom) function
- We already have equals with matchAction Any to handle this functionality,
is there any reason why you need it to be a function and not a filter?
- There are examples where filters have been repurposed as functions
already, for example the equalTo(a,b): Boolean function. I would follow
that example.

equalTo( value, value, matchPolicy ) - where matchPolicy is "All", "Any" or
"One"


Given the above concerns I would be happy to have a breakout chat with you
to work through the above.
--
Jody Garnett


On Thu, 23 Apr 2020 at 08:50, Mauro Bartolomeoli <
mauro.bartolome...@geo-solutions.it> wrote:

> Hi,
> I would like to add two new filter functions:
>  - arrayOverlap, that takes two arrays and returns true if the arrays have
> at least one item in common
>  - arrayFromString that takes a delimited string, a target class name and
> a delimiter that can be used to create arrays of values from a string
>
> The first one would also have an optimization in jdbc-postgis (using the
> && overlap operator).
> The second one would allow expressing array literals in ECQL filters.
>
> Example of combined use:
>
> arrayOverlap(identifiers, arrayFromString('1,2,3', 'java.lang.Integer',
> ',')
>
> Any concern?
>
> --
>
> Regards,
>
> Mauro Bartolomeoli
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Dott. Mauro Bartolomeoli
> @mauro_bart
> Technical Lead
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
>
> mobile: +39 393 904 1756
> phone: +39 0584 962313
> fax:  +39 0584 1660272
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> ---
>
> Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE
> 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si
> precisa che ogni circostanza inerente alla presente email (il suo
> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è
> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il
> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra
> operazione è illecita. Le sarei comunque grato se potesse darmene notizia.
>
> This email is intended only for the person or entity to which it is
> addressed and may contain information that is privileged, confidential or
> otherwise protected from disclosure. We remind that - as provided by
> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this
> e-mail or the information herein by anyone other than the intended
> recipient is prohibited. If you have received this email by mistake, please
> notify us immediately by telephone or e-mail.
> ___
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
___
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel