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));
}
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));
}
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);
}
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));
}
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;
}
Aggregations