Search in sources :

Example 6 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class WfsFilterDelegate method not.

@Override
public FilterType not(FilterType filterToBeNoted) {
    FilterType returnFilter = new FilterType();
    if (filterToBeNoted == null) {
        return returnFilter;
    }
    UnaryLogicOpType notType = new UnaryLogicOpType();
    if (filterToBeNoted.isSetComparisonOps()) {
        notType.setComparisonOps(filterToBeNoted.getComparisonOps());
    } else if (filterToBeNoted.isSetLogicOps()) {
        notType.setLogicOps(filterToBeNoted.getLogicOps());
    } else if (filterToBeNoted.isSetSpatialOps()) {
        notType.setSpatialOps(filterToBeNoted.getSpatialOps());
    } else {
        return returnFilter;
    }
    returnFilter.setLogicOps(filterObjectFactory.createNot(notType));
    return returnFilter;
}
Also used : UnaryLogicOpType(ogc.schema.opengis.filter.v_1_0_0.UnaryLogicOpType) FilterType(ogc.schema.opengis.filter.v_1_0_0.FilterType)

Example 7 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class TestWfsFilterDelegate method testDisjointAsNotBBox.

@Test
public void testDisjointAsNotBBox() throws SAXException, IOException, JAXBException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.BBOX.toString());
    FilterType filter = delegate.disjoint(Metacard.ANY_GEO, POLYGON);
    assertTrue(filter.getLogicOps().getValue() instanceof UnaryLogicOpType);
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertTrue(type.getSpatialOps().getValue() instanceof BBOXType);
    assertXMLEqual(MockWfsServer.getNotBboxXmlFilter(), getXmlFromMarshaller(filter));
}
Also used : UnaryLogicOpType(net.opengis.filter.v_2_0_0.UnaryLogicOpType) FilterType(net.opengis.filter.v_2_0_0.FilterType) BBOXType(net.opengis.filter.v_2_0_0.BBOXType) Test(org.junit.Test)

Example 8 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class TestWfsFilterDelegate method testDwithinAsNotBeyond.

@Test
public void testDwithinAsNotBeyond() {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Beyond.toString());
    FilterType filter = delegate.dwithin(Metacard.ANY_GEO, POLYGON, DISTANCE);
    assertTrue(filter.getLogicOps().getValue() instanceof UnaryLogicOpType);
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertTrue(type.getSpatialOps().getValue() instanceof DistanceBufferType);
}
Also used : UnaryLogicOpType(net.opengis.filter.v_2_0_0.UnaryLogicOpType) FilterType(net.opengis.filter.v_2_0_0.FilterType) DistanceBufferType(net.opengis.filter.v_2_0_0.DistanceBufferType) Test(org.junit.Test)

Example 9 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class TestCswFilterDelegate method testPropertyIsLikeNot.

@Test
public void testPropertyIsLikeNot() throws JAXBException, SAXException, IOException {
    FilterType propertyIsLikeFilter = cswFilterDelegateLatLon.propertyIsLike(propertyName, likeLiteral, isCaseSensitive);
    FilterType filter = cswFilterDelegateLatLon.not(propertyIsLikeFilter);
    assertThat(filter, notNullValue());
    assertThat(filter.getLogicOps().getName(), is(NOT_LOGIC_OPS_NAME));
    UnaryLogicOpType ulot = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertThat(ulot, notNullValue());
}
Also used : UnaryLogicOpType(net.opengis.filter.v_1_1_0.UnaryLogicOpType) FilterType(net.opengis.filter.v_1_1_0.FilterType) Test(org.junit.Test)

Example 10 with UnaryLogicOpType

use of net.opengis.filter.v_2_0_0.UnaryLogicOpType in project ddf by codice.

the class TestWfsFilterDelegate method testBeyondAsNotDwithin.

@Test
public void testBeyondAsNotDwithin() {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.DWithin.toString());
    FilterType filter = delegate.beyond(Metacard.ANY_GEO, POLYGON, DISTANCE);
    assertTrue(filter.getLogicOps().getValue() instanceof UnaryLogicOpType);
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertTrue(type.getSpatialOps().getValue() instanceof DistanceBufferType);
}
Also used : UnaryLogicOpType(net.opengis.filter.v_2_0_0.UnaryLogicOpType) FilterType(net.opengis.filter.v_2_0_0.FilterType) DistanceBufferType(net.opengis.filter.v_2_0_0.DistanceBufferType) Test(org.junit.Test)

Aggregations

FilterType (net.opengis.filter.v_2_0_0.FilterType)9 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)9 Test (org.junit.Test)9 DistanceBufferType (net.opengis.filter.v_2_0_0.DistanceBufferType)3 FilterType (net.opengis.filter.v_1_1_0.FilterType)2 UnaryLogicOpType (net.opengis.filter.v_1_1_0.UnaryLogicOpType)2 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)2 PropertyIsLikeType (net.opengis.filter.v_2_0_0.PropertyIsLikeType)2 ArrayList (java.util.ArrayList)1 BBOXType (net.opengis.filter.v_2_0_0.BBOXType)1 BinaryLogicOpType (net.opengis.filter.v_2_0_0.BinaryLogicOpType)1 FilterType (ogc.schema.opengis.filter.v_1_0_0.FilterType)1 UnaryLogicOpType (ogc.schema.opengis.filter.v_1_0_0.UnaryLogicOpType)1