Search in sources :

Example 6 with FunctionImpl

use of org.geotools.filter.FunctionImpl in project ddf by codice.

the class SolrFilterBuilderTest method proximity.

public Filter proximity(String attribute, int distance, String searchTerms) {
    FunctionImpl function = new FunctionImpl();
    function.setName(ProximityFunction.NAME.getName());
    List<Expression> parameters = new ArrayList<>();
    parameters.add(factory.literal(attribute));
    parameters.add(factory.literal(distance));
    parameters.add(factory.literal(searchTerms));
    function.setParameters(parameters);
    return factory.equals(function, factory.literal(true));
}
Also used : Expression(org.opengis.filter.expression.Expression) FunctionImpl(org.geotools.filter.FunctionImpl) ArrayList(java.util.ArrayList)

Aggregations

FunctionImpl (org.geotools.filter.FunctionImpl)6 Expression (org.opengis.filter.expression.Expression)4 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 FunctionExpression (org.geotools.filter.FunctionExpression)2 EnvFunction (org.geotools.filter.function.EnvFunction)2 FunctionName (org.opengis.filter.capability.FunctionName)2 ExpressionNode (com.sldeditor.filter.v2.expression.ExpressionNode)1 AttributeExpressionImpl (org.geotools.filter.AttributeExpressionImpl)1 LiteralExpressionImpl (org.geotools.filter.LiteralExpressionImpl)1 MathExpressionImpl (org.geotools.filter.MathExpressionImpl)1 DefaultFunctionFactory (org.geotools.filter.function.DefaultFunctionFactory)1 ConcatenateFunction (org.geotools.filter.function.string.ConcatenateFunction)1 FilterFactory (org.opengis.filter.FilterFactory)1 Function (org.opengis.filter.expression.Function)1 Parameter (org.opengis.parameter.Parameter)1