Search in sources :

Example 56 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method greater.

@Override
public BinaryComparisonOperator<Object> greater(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2, final boolean matchCase, final MatchAction action) {
    LiteralType lit = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
    }
    if (expr1 instanceof LiteralType) {
        lit = (LiteralType) expr1;
    } else if (expr2 instanceof LiteralType) {
        lit = (LiteralType) expr2;
    }
    return new PropertyIsGreaterThanType(lit, propName, matchCase);
}
Also used : PropertyIsGreaterThanType(org.geotoolkit.ogc.xml.v110.PropertyIsGreaterThanType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 57 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method equals.

@Override
public BinarySpatialOperator<Object> equals(final Expression<Object, ?> geometry1, final Expression<Object, ?> geometry2) {
    PropertyNameType propertyName = null;
    if (geometry1 instanceof PropertyNameType) {
        propertyName = (PropertyNameType) geometry1;
    } else {
        throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + geometry1.getClass().getSimpleName());
    }
    // we transform the JTS geometry into a GML geometry
    Object geom = null;
    if (geometry2 instanceof LiteralType) {
        geom = ((LiteralType) geometry2).getValue();
        geom = GeometryToGML(geom);
    }
    return new EqualsType(propertyName, geom);
}
Also used : EqualsType(org.geotoolkit.ogc.xml.v110.EqualsType) TimeEqualsType(org.geotoolkit.ogc.xml.v110.TimeEqualsType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 58 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method overlaps.

@Override
public BinarySpatialOperator<Object> overlaps(final Expression<Object, ?> geometry1, final Expression<Object, ?> geometry2) {
    PropertyNameType propertyName = null;
    if (geometry1 instanceof PropertyNameType) {
        propertyName = (PropertyNameType) geometry1;
    } else {
        throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + geometry1.getClass().getSimpleName());
    }
    // we transform the JTS geometry into a GML geometry
    Object geom = null;
    if (geometry2 instanceof LiteralType) {
        geom = ((LiteralType) geometry2).getValue();
        geom = GeometryToGML(geom);
    }
    return new OverlapsType(propertyName, geom);
}
Also used : TimeOverlapsType(org.geotoolkit.ogc.xml.v110.TimeOverlapsType) OverlapsType(org.geotoolkit.ogc.xml.v110.OverlapsType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 59 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method less.

@Override
public BinaryComparisonOperator<Object> less(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    LiteralType lit = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
    }
    if (expr1 instanceof LiteralType) {
        lit = (LiteralType) expr1;
    } else if (expr2 instanceof LiteralType) {
        lit = (LiteralType) expr2;
    }
    return new PropertyIsLessThanType(lit, propName, null);
}
Also used : PropertyIsLessThanType(org.geotoolkit.ogc.xml.v110.PropertyIsLessThanType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 60 with LiteralType

use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method intersects.

@Override
public BinarySpatialOperator<Object> intersects(final Expression<Object, ?> geometry1, final Expression<Object, ?> geometry2) {
    PropertyNameType propertyName = null;
    if (geometry1 instanceof PropertyNameType) {
        propertyName = (PropertyNameType) geometry1;
    } else {
        throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + geometry1.getClass().getSimpleName());
    }
    // we transform the JTS geometry into a GML geometry
    Object geom = null;
    if (geometry2 instanceof LiteralType) {
        geom = ((LiteralType) geometry2).getValue();
        geom = GeometryToGML(geom);
    }
    return new IntersectsType(propertyName, geom);
}
Also used : LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) IntersectsType(org.geotoolkit.ogc.xml.v110.IntersectsType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Aggregations

JAXBElement (javax.xml.bind.JAXBElement)40 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)40 PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)40 Literal (org.opengis.filter.Literal)35 Marshaller (javax.xml.bind.Marshaller)34 Unmarshaller (javax.xml.bind.Unmarshaller)34 Test (org.junit.Test)34 ValueReference (org.opengis.filter.ValueReference)34 Filter (org.opengis.filter.Filter)26 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)21 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)17 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)16 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)14 FilterType (org.geotoolkit.ogc.xml.v100.FilterType)11 Expression (org.opengis.filter.Expression)11 LiteralType (org.flyte.api.v1.LiteralType)10 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v100.BinaryComparisonOpType)9 ComparisonOpsType (org.geotoolkit.ogc.xml.v100.ComparisonOpsType)9 BinaryComparisonOpType (org.geotoolkit.ogc.xml.v110.BinaryComparisonOpType)9 LogicalOperator (org.opengis.filter.LogicalOperator)9