Search in sources :

Example 21 with UnaryLogicOpType

use of org.geotoolkit.ogc.xml.v100.UnaryLogicOpType in project ddf by codice.

the class WfsFilterDelegateTest method testDwithinAsNotBeyond.

@Test
public void testDwithinAsNotBeyond() {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.BEYOND.getValue(), new LatLonCoordinateStrategy());
    FilterType filter = delegate.dwithin(Metacard.ANY_GEO, POLYGON, DISTANCE);
    assertThat(filter.getLogicOps().getValue(), is(instanceOf(UnaryLogicOpType.class)));
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertThat(type.getSpatialOps().getValue(), is(instanceOf(DistanceBufferType.class)));
}
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 22 with UnaryLogicOpType

use of org.geotoolkit.ogc.xml.v100.UnaryLogicOpType in project ddf by codice.

the class WfsFilterDelegateTest method testIntersectsAsNotDisjoint.

@Test
public void testIntersectsAsNotDisjoint() {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.DISJOINT.getValue(), new LatLonCoordinateStrategy());
    FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
    assertThat(filter.isSetLogicOps(), is(true));
    assertThat(filter.getLogicOps().getValue(), is(instanceOf(UnaryLogicOpType.class)));
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertThat(type.isSetSpatialOps(), is(true));
    assertThat(type.getSpatialOps().getValue(), is(instanceOf(BinarySpatialOpType.class)));
}
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 23 with UnaryLogicOpType

use of org.geotoolkit.ogc.xml.v100.UnaryLogicOpType in project ddf by codice.

the class WfsFilterDelegateTest method testBeyondAsNotDwithin.

@Test
public void testBeyondAsNotDwithin() {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.DWITHIN.getValue(), new LatLonCoordinateStrategy());
    FilterType filter = delegate.beyond(Metacard.ANY_GEO, POLYGON, DISTANCE);
    assertThat(filter.getLogicOps().getValue(), is(instanceOf(UnaryLogicOpType.class)));
    UnaryLogicOpType type = (UnaryLogicOpType) filter.getLogicOps().getValue();
    assertThat(type.getSpatialOps().getValue(), is(instanceOf(DistanceBufferType.class)));
}
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 24 with UnaryLogicOpType

use of org.geotoolkit.ogc.xml.v100.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 25 with UnaryLogicOpType

use of org.geotoolkit.ogc.xml.v100.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

Test (org.junit.Test)24 FilterType (net.opengis.filter.v_2_0_0.FilterType)17 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)17 FilterType (net.opengis.filter.v_1_1_0.FilterType)8 UnaryLogicOpType (net.opengis.filter.v_1_1_0.UnaryLogicOpType)8 DistanceBufferType (net.opengis.filter.v_2_0_0.DistanceBufferType)6 JAXBElement (javax.xml.bind.JAXBElement)5 ArrayList (java.util.ArrayList)4 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)4 PropertyIsLikeType (net.opengis.filter.v_2_0_0.PropertyIsLikeType)4 UnaryLogicOpType (org.geosdi.geoplatform.xml.filter.v110.UnaryLogicOpType)4 Marshaller (javax.xml.bind.Marshaller)2 Unmarshaller (javax.xml.bind.Unmarshaller)2 BBOXType (net.opengis.filter.v_2_0_0.BBOXType)2 BinaryLogicOpType (net.opengis.filter.v_2_0_0.BinaryLogicOpType)2 BinaryLogicOpType (org.geosdi.geoplatform.xml.filter.v110.BinaryLogicOpType)2 BinaryComparisonOperator (org.opengis.filter.BinaryComparisonOperator)2 Filter (org.opengis.filter.Filter)2 Literal (org.opengis.filter.Literal)2 LogicalOperator (org.opengis.filter.LogicalOperator)2