Search in sources :

Example 56 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method crosses.

@Override
public BinarySpatialOperator<Object> crosses(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 CrossesType(propertyName, geom);
}
Also used : LiteralType(org.geotoolkit.ogc.xml.v110.LiteralType) CrossesType(org.geotoolkit.ogc.xml.v110.CrossesType) PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType)

Example 57 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method greater.

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

Example 58 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method during.

@Override
public TemporalOperator<Object> during(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 TimeDuringType(propName.getXPath(), temporal);
}
Also used : PropertyNameType(org.geotoolkit.ogc.xml.v110.PropertyNameType) TimeDuringType(org.geotoolkit.ogc.xml.v110.TimeDuringType)

Example 59 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType in project geotoolkit by Geomatys.

the class FilterFactoryImpl method greaterOrEqual.

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

Example 60 with PropertyNameType

use of org.geosdi.geoplatform.xml.filter.v110.PropertyNameType 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)

Aggregations

PropertyNameType (org.geotoolkit.ogc.xml.v110.PropertyNameType)62 JAXBElement (javax.xml.bind.JAXBElement)46 LiteralType (org.geotoolkit.ogc.xml.v110.LiteralType)38 Test (org.junit.Test)38 Unmarshaller (javax.xml.bind.Unmarshaller)37 Marshaller (javax.xml.bind.Marshaller)36 ValueReference (org.opengis.filter.ValueReference)36 Literal (org.opengis.filter.Literal)30 Filter (org.opengis.filter.Filter)26 PropertyNameType (org.geotoolkit.ogc.xml.v100.PropertyNameType)20 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)20 LiteralType (org.geotoolkit.ogc.xml.v100.LiteralType)16 FilterType (org.geotoolkit.ogc.xml.v110.FilterType)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