Search in sources :

Example 26 with FilterType

use of ogc.schema.opengis.filter.v_1_0_0.FilterType in project ddf by codice.

the class CswFilterFactory method getFeatureIds.

private Set<String> getFeatureIds(List<FilterType> filters) {
    Set<String> ids = new HashSet<String>();
    if (!CollectionUtils.isEmpty(filters)) {
        boolean isFeatureIdFilter = filters.get(0) != null && filters.get(0).isSetId();
        for (FilterType filter : filters) {
            if ((filter != null && filter.isSetId()) != isFeatureIdFilter) {
                throw new UnsupportedOperationException("Query with mix of FeatureID and non-FeatureID queries not supported.");
            }
            if (isFeatureIdFilter) {
                Iterator<JAXBElement<? extends AbstractIdType>> iter = filter.getId().iterator();
                while (iter.hasNext()) {
                    @SuppressWarnings("unchecked") FeatureIdType idType = ((JAXBElement<FeatureIdType>) iter.next()).getValue();
                    ids.add(idType.getFid());
                }
            }
        }
    }
    return ids;
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) JAXBElement(javax.xml.bind.JAXBElement) AbstractIdType(net.opengis.filter.v_1_1_0.AbstractIdType) FeatureIdType(net.opengis.filter.v_1_1_0.FeatureIdType) HashSet(java.util.HashSet)

Example 27 with FilterType

use of ogc.schema.opengis.filter.v_1_0_0.FilterType in project ddf by codice.

the class CswFilterFactory method buildPropertyIsGreaterThanFilter.

public FilterType buildPropertyIsGreaterThanFilter(String propertyName, Object literal) {
    FilterType filter = new FilterType();
    filter.setComparisonOps(createPropertyIsGreaterThan(propertyName, literal));
    return filter;
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType)

Example 28 with FilterType

use of ogc.schema.opengis.filter.v_1_0_0.FilterType in project ddf by codice.

the class TestCswCqlFilter method testPropertyBetweenLongLiterals.

@Test
public void testPropertyBetweenLongLiterals() throws UnsupportedQueryException {
    FilterType filterType = cswFilterDelegate.propertyIsBetween(propertyName, longLowerBoundary, longUpperBoundary);
    String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
    assertThat(propertyIsBetween, is(cqlText));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Example 29 with FilterType

use of ogc.schema.opengis.filter.v_1_0_0.FilterType in project ddf by codice.

the class TestCswCqlFilter method testPropertyIsLessThanDoubleLiteral.

@Test
public void testPropertyIsLessThanDoubleLiteral() throws UnsupportedQueryException {
    FilterType filterType = cswFilterDelegate.propertyIsLessThan(propertyName, doubleLiteral);
    String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
    assertThat(propertyIsLessThanWithDecimal, is(cqlText));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Example 30 with FilterType

use of ogc.schema.opengis.filter.v_1_0_0.FilterType in project ddf by codice.

the class TestCswCqlFilter method testPropertyIsEqualToFloatLiteral.

@Test
public void testPropertyIsEqualToFloatLiteral() throws UnsupportedQueryException {
    FilterType filterType = cswFilterDelegate.propertyIsEqualTo(propertyName, floatLiteral);
    String cqlText = CswCqlTextFilter.getInstance().getCqlText(filterType);
    assertThat(propertyIsEqualToWithDecimal, is(cqlText));
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)212 FilterType (net.opengis.filter.v_1_1_0.FilterType)209 FilterType (net.opengis.filter.v_2_0_0.FilterType)58 ArrayList (java.util.ArrayList)50 JAXBElement (javax.xml.bind.JAXBElement)12 CswSourceConfiguration (org.codice.ddf.spatial.ogc.csw.catalog.common.CswSourceConfiguration)12 BinaryTemporalOpType (net.opengis.filter.v_2_0_0.BinaryTemporalOpType)11 FeatureAttributeDescriptor (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureAttributeDescriptor)11 QName (javax.xml.namespace.QName)10 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)10 LineString (com.vividsolutions.jts.geom.LineString)9 Date (java.util.Date)9 DistanceBufferType (net.opengis.filter.v_2_0_0.DistanceBufferType)9 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)9 DateTime (org.joda.time.DateTime)8 Method (java.lang.reflect.Method)7 QueryConstraintType (net.opengis.cat.csw.v_2_0_2.QueryConstraintType)7 FilterCapabilities (net.opengis.filter.v_2_0_0.FilterCapabilities)7 TimePeriodType (net.opengis.gml.v_3_2_1.TimePeriodType)7 TimePositionType (net.opengis.gml.v_3_2_1.TimePositionType)7