Search in sources :

Example 6 with ValueReference

use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.

the class FilterFactory2 method disjoint.

public BinarySpatialOperator<Object> disjoint(final String propertyName, final Geometry geometry) {
    final ValueReference name = property(propertyName);
    final Literal geom = super.literal(geometry);
    return disjoint(name, geom);
}
Also used : Literal(org.opengis.filter.Literal) ValueReference(org.opengis.filter.ValueReference)

Example 7 with ValueReference

use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.

the class FilterFactory2 method touches.

public BinarySpatialOperator<Object> touches(final String propertyName, final Geometry geometry) {
    final ValueReference name = property(propertyName);
    final Literal geom = super.literal(geometry);
    return touches(name, geom);
}
Also used : Literal(org.opengis.filter.Literal) ValueReference(org.opengis.filter.ValueReference)

Example 8 with ValueReference

use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.

the class FilterFactory2 method dwithin.

public DistanceOperator<Object> dwithin(final String propertyName, final Geometry geometry, final double distance, final String units) {
    final ValueReference name = property(propertyName);
    final Literal geom = super.literal(geometry);
    return dwithin(name, geom, distance, units);
}
Also used : Literal(org.opengis.filter.Literal) ValueReference(org.opengis.filter.ValueReference)

Example 9 with ValueReference

use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.

the class FilterFactory2 method beyond.

public DistanceOperator<Object> beyond(final String propertyName, final Geometry geometry, final double distance, final String units) {
    final ValueReference name = property(propertyName);
    final Literal geom = super.literal(geometry);
    return beyond(name, geom, distance, units);
}
Also used : Literal(org.opengis.filter.Literal) ValueReference(org.opengis.filter.ValueReference)

Example 10 with ValueReference

use of org.opengis.filter.ValueReference in project geotoolkit by Geomatys.

the class GroovyFunction method apply.

@Override
public Object apply(final Object feature) {
    Binding bindings = new Binding();
    for (int i = 1, n = parameters.size(); i < n; i++) {
        final ValueReference property = (ValueReference) parameters.get(i);
        final Object value = property.apply(feature);
        bindings.setVariable(VAR_CHARACTER + property.getXPath(), value);
    }
    try {
        final Script script = getCompiled();
        script.setBinding(bindings);
        return script.run();
    } catch (CompilationFailedException ex) {
        Logger.getLogger("org.geotoolkit.filter.function.groovy").log(Level.WARNING, null, ex);
    }
    return "";
}
Also used : Binding(groovy.lang.Binding) Script(groovy.lang.Script) CompilationFailedException(org.codehaus.groovy.control.CompilationFailedException) ValueReference(org.opengis.filter.ValueReference)

Aggregations

ValueReference (org.opengis.filter.ValueReference)82 Literal (org.opengis.filter.Literal)53 Test (org.junit.Test)52 JAXBElement (javax.xml.bind.JAXBElement)39 Filter (org.opengis.filter.Filter)39 Marshaller (javax.xml.bind.Marshaller)36 Unmarshaller (javax.xml.bind.Unmarshaller)36 Expression (org.opengis.filter.Expression)27 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)25 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)18 PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)18 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)16 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)16 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)14 FilterType (org.geotoolkit.ogc.xml.v100.FilterType)12 LogicalOperator (org.opengis.filter.LogicalOperator)12 ComparisonOpsType (org.geotoolkit.ogc.xml.v100.ComparisonOpsType)10 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType)9 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v110.BinaryComparisonOpType)9 ComparisonOpsType (org.geotoolkit.ogc.xml.v110.ComparisonOpsType)9