Hide
added a comment -
I would like to keep this open until we are done the work for the proposal (no half measures etc..).
I have had some good luck using the following approach:
import static org.geotools.filter.capability.FunctionNameImpl.parameter;
...
public static FunctionName NAME = new FunctionNameImpl("rint",
parameter("related", Boolean.class),
parameter("geometry", Geometry.class),
parameter("geometry", Geometry.class),
parameter("pattern", String.class));
Show
added a comment - I would like to keep this open until we are done the work for the proposal (no half measures etc..).
I have had some good luck using the following approach:
import static org.geotools.filter.capability.FunctionNameImpl.parameter;
...
public static FunctionName NAME = new FunctionNameImpl("rint",
parameter("related", Boolean.class),
parameter("geometry", Geometry.class),
parameter("geometry", Geometry.class),
parameter("pattern", String.class));
- factory creation of function name should not be subject to any restrictions we have on the GeoTools side of things (as we need the data structure to communicate the capabilities of external services and sql functions etc...)
- existing symbology encoding functions support several parameters with multiplicity (not just the last one)
- existing app schema functions support several optional parameters (not just the last one)
With that in mind I would like to remove the validation check; if a function implementor wants to take on the pain of sorting out things they should be able to do so. Note this does not require the introduction of named parameters or any change to the FunctionFinder (lookup is on function name only).
Options:
a) just remove the validation check
b) remove the validation check from the factory and the direct FunctionNameImpl calls; leaving it in the utility method as a way to encourage function implementors from taking on too much work