Search in sources :

Example 21 with FilterType

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

the class TestWfsFilterDelegate method testContainsFilter.

@Test
public void testContainsFilter() throws JAXBException, SAXException, IOException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Contains.toString());
    FilterType filter = delegate.contains(Metacard.ANY_GEO, POLYGON);
    assertTrue(filter.getSpatialOps().getValue() instanceof BinarySpatialOpType);
    assertFalse(filter.isSetLogicOps());
    assertXMLEqual(MockWfsServer.getContainsXmlFilter(), getXmlFromMarshaller(filter));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) BinarySpatialOpType(net.opengis.filter.v_2_0_0.BinarySpatialOpType) Test(org.junit.Test)

Example 22 with FilterType

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

the class TestWfsFilterDelegate method testCrossesFilter.

@Test
public void testCrossesFilter() throws SAXException, IOException, JAXBException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Crosses.toString());
    FilterType filter = delegate.crosses(Metacard.ANY_GEO, LINESTRING);
    assertTrue(filter.getSpatialOps().getValue() instanceof BinarySpatialOpType);
    assertFalse(filter.isSetLogicOps());
    assertXMLEqual(MockWfsServer.getCrossesXmlFilter(), getXmlFromMarshaller(filter));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) BinarySpatialOpType(net.opengis.filter.v_2_0_0.BinarySpatialOpType) Test(org.junit.Test)

Example 23 with FilterType

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

the class TestWfsFilterDelegate method testLogicalAndNoLogicalSupport.

@Test(expected = UnsupportedOperationException.class)
public void testLogicalAndNoLogicalSupport() throws Exception {
    WfsFilterDelegate delegate = makeDelegateForLogicalSupportTests();
    FilterType compFilter1 = delegate.propertyIsLike(Metacard.ANY_TEXT, LITERAL, true);
    FilterType compFilter2 = delegate.propertyIsLike(Metacard.ANY_TEXT, LITERAL, true);
    List<FilterType> filtersToBeAnded = new ArrayList<>();
    filtersToBeAnded.add(compFilter1);
    filtersToBeAnded.add(compFilter2);
    //Perform Test
    delegate.and(filtersToBeAnded);
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 24 with FilterType

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

the class TestWfsFilterDelegate method testDWithinFilterPolygon.

@Test
public void testDWithinFilterPolygon() throws SAXException, IOException, JAXBException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.DWithin.toString());
    FilterType filter = delegate.dwithin(Metacard.ANY_GEO, POLYGON, DISTANCE);
    assertFalse(filter.isSetLogicOps());
    assertTrue(filter.isSetSpatialOps());
    assertTrue(filter.getSpatialOps().getValue() instanceof DistanceBufferType);
    assertXMLEqual(MockWfsServer.getDWithinXmlFilter(), getXmlFromMarshaller(filter));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) DistanceBufferType(net.opengis.filter.v_2_0_0.DistanceBufferType) Test(org.junit.Test)

Example 25 with FilterType

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

the class CswFilterFactory method buildBBoxGeospatialFilter.

public FilterType buildBBoxGeospatialFilter(String propertyName, String wkt) {
    FilterType filter = new FilterType();
    filter.setSpatialOps(createBBoxType(propertyName, wkt));
    return filter;
}
Also used : FilterType(net.opengis.filter.v_1_1_0.FilterType)

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