Search in sources :

Example 76 with PropertyNameType

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

the class FilterFactoryImpl method overlappedBy.

@Override
public TemporalOperator<Object> overlappedBy(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    Object temporal = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
        temporal = expr2;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
        temporal = expr1;
    }
    return new TimeOverlappedByType(propName.getXPath(), temporal);
}
Also used : TimeOverlappedByType(org.geotoolkit.ogc.xml.v110.TimeOverlappedByType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 77 with PropertyNameType

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

the class FilterFactoryImpl method before.

@Override
public TemporalOperator<Object> before(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
    Object temporal = null;
    PropertyNameType propName = null;
    if (expr1 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr1;
        temporal = expr2;
    } else if (expr2 instanceof PropertyNameType) {
        propName = (PropertyNameType) expr2;
        temporal = expr1;
    }
    return new TimeBeforeType(propName.getXPath(), temporal);
}
Also used : TimeBeforeType(org.geotoolkit.ogc.xml.v110.TimeBeforeType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 78 with PropertyNameType

use of org.geotoolkit.ogc.xml.v110.PropertyNameType 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 79 with PropertyNameType

use of org.geotoolkit.ogc.xml.v110.PropertyNameType 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)

Example 80 with PropertyNameType

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

the class FilterFactoryImpl method notEqual.

@Override
public BinaryComparisonOperator<Object> notEqual(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 PropertyIsNotEqualToType(lit, propName, matchCase);
}
Also used : PropertyIsNotEqualToType(org.geotoolkit.ogc.xml.v110.PropertyIsNotEqualToType) LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Aggregations

PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)62 JAXBElement (javax.xml.bind.JAXBElement)47 Test (org.junit.Test)39 Unmarshaller (javax.xml.bind.Unmarshaller)38 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)38 Marshaller (javax.xml.bind.Marshaller)37 ValueReference (org.opengis.filter.ValueReference)37 Literal (org.opengis.filter.Literal)31 Filter (org.opengis.filter.Filter)27 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)20 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)20 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)17 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)16 PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)13 FilterType (org.geotoolkit.ogc.xml.v100.FilterType)12 Expression (org.opengis.filter.Expression)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