Search in sources :

Example 1 with BBOXType

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

the class TestWfsFilterDelegate method testIntersectsAsBoundingBox.

@Test
public void testIntersectsAsBoundingBox() throws SAXException, IOException, JAXBException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.BBOX.toString());
    FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
    assertNotNull(filter);
    assertTrue(filter.getSpatialOps().getValue() instanceof BBOXType);
    assertFalse(filter.isSetLogicOps());
    assertXMLEqual(MockWfsServer.getBboxXmlFilter(), getXmlFromMarshaller(filter));
}
Also used : FilterType(net.opengis.filter.v_2_0_0.FilterType) BBOXType(net.opengis.filter.v_2_0_0.BBOXType) Test(org.junit.Test)

Example 2 with BBOXType

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

the class WfsFilterDelegate method buildBBoxType.

private JAXBElement<BBOXType> buildBBoxType(String propertyName, String wkt) {
    BBOXType bboxType = new BBOXType();
    JAXBElement<BoxType> box = createBoxType(wkt);
    bboxType.setBox(box.getValue());
    bboxType.setPropertyName(createPropertyNameType(propertyName).getValue());
    return filterObjectFactory.createBBOX(bboxType);
}
Also used : BBOXType(ogc.schema.opengis.filter.v_1_0_0.BBOXType) BoxType(ogc.schema.opengis.gml.v_2_1_2.BoxType)

Example 3 with BBOXType

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

the class CswFilterFactory method createBBoxType.

private JAXBElement<BBOXType> createBBoxType(String propertyName, String wkt) {
    BBOXType bboxType = new BBOXType();
    JAXBElement<EnvelopeType> envelope = createEnvelopeType(wkt);
    bboxType.setEnvelope(envelope);
    bboxType.setPropertyName(createPropertyNameType(propertyName));
    return filterObjectFactory.createBBOX(bboxType);
}
Also used : EnvelopeType(net.opengis.gml.v_3_1_1.EnvelopeType) BBOXType(net.opengis.filter.v_1_1_0.BBOXType)

Example 4 with BBOXType

use of net.opengis.filter.v_2_0_0.BBOXType 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 5 with BBOXType

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

the class WfsFilterDelegate method buildBBoxType.

private JAXBElement<BBOXType> buildBBoxType(String propertyName, String wkt) {
    BBOXType bboxType = new BBOXType();
    bboxType.setExpression(filterObjectFactory.createValueReference(propertyName));
    try {
        bboxType.setAny(createEnvelope(getGeometryFromWkt(wkt)));
    } catch (ParseException e) {
        throw new UnsupportedOperationException("Unable to parse WKT Geometry [" + wkt + "]", e);
    }
    return filterObjectFactory.createBBOX(bboxType);
}
Also used : BBOXType(net.opengis.filter.v_2_0_0.BBOXType) ParseException(com.vividsolutions.jts.io.ParseException)

Aggregations

BBOXType (net.opengis.filter.v_2_0_0.BBOXType)3 FilterType (net.opengis.filter.v_2_0_0.FilterType)2 Test (org.junit.Test)2 ParseException (com.vividsolutions.jts.io.ParseException)1 BBOXType (net.opengis.filter.v_1_1_0.BBOXType)1 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)1 EnvelopeType (net.opengis.gml.v_3_1_1.EnvelopeType)1 BBOXType (ogc.schema.opengis.filter.v_1_0_0.BBOXType)1 BoxType (ogc.schema.opengis.gml.v_2_1_2.BoxType)1