Search in sources :

Example 1 with DistanceBufferType

use of net.opengis.filter.v_1_1_0.DistanceBufferType in project ddf by codice.

the class CswQueryFactoryTest method testPostGetRecordsSpatialBeyondOgcFilter.

@Test
public void testPostGetRecordsSpatialBeyondOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
    DistanceBufferType op = createDistanceBufferType();
    ogcSpatialRelativeQuery(Beyond.class, filterObjectFactory.createBeyond(op));
}
Also used : DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) Test(org.junit.Test)

Example 2 with DistanceBufferType

use of net.opengis.filter.v_1_1_0.DistanceBufferType in project ddf by codice.

the class CswQueryFactoryTest method createDistanceBufferType.

private DistanceBufferType createDistanceBufferType() {
    DistanceBufferType distanceBuffer = new DistanceBufferType();
    PropertyNameType propName = new PropertyNameType();
    propName.getContent().add(SPATIAL_TEST_ATTRIBUTE);
    distanceBuffer.setPropertyName(propName);
    DistanceType distance = filterObjectFactory.createDistanceType();
    distance.setUnits(REL_GEO_UNITS);
    distance.setContent(Double.toString(REL_GEO_DISTANCE));
    distanceBuffer.setDistance(distance);
    distanceBuffer.setGeometry(createPolygon());
    return distanceBuffer;
}
Also used : DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) DistanceType(net.opengis.filter.v_1_1_0.DistanceType) PropertyNameType(net.opengis.filter.v_1_1_0.PropertyNameType)

Example 3 with DistanceBufferType

use of net.opengis.filter.v_1_1_0.DistanceBufferType in project ddf by codice.

the class CswQueryFactoryTest method testPostGetRecordsSpatialDWithinOgcFilter.

@Test
public void testPostGetRecordsSpatialDWithinOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
    DistanceBufferType op = createDistanceBufferType();
    ogcSpatialRelativeQuery(DWithin.class, filterObjectFactory.createDWithin(op));
}
Also used : DistanceBufferType(net.opengis.filter.v_1_1_0.DistanceBufferType) Test(org.junit.Test)

Example 4 with DistanceBufferType

use of net.opengis.filter.v_1_1_0.DistanceBufferType in project ddf by codice.

the class TestWfsFilterDelegate method testBeyondFilter.

@Test
public void testBeyondFilter() throws JAXBException, SAXException, IOException {
    WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Beyond.toString());
    FilterType filter = delegate.beyond(Metacard.ANY_GEO, POLYGON, DISTANCE);
    assertTrue(filter.isSetSpatialOps());
    assertTrue(filter.getSpatialOps().getValue() instanceof DistanceBufferType);
    assertXMLEqual(MockWfsServer.getBeyondXmlFilter(), 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 5 with DistanceBufferType

use of net.opengis.filter.v_1_1_0.DistanceBufferType in project ddf by codice.

the class TestWfsFilterDelegate method testLogicalNotOfSpatial.

@Test
public void testLogicalNotOfSpatial() throws Exception {
    String mockProperty = "myPropertyName";
    String mockType = "myType";
    WfsFilterDelegate delegate = mockFeatureMetacardCreateDelegate(mockProperty, mockType);
    FilterType spatialFilter1 = delegate.dwithin(Metacard.ANY_GEO, "POINT (30 10)", Double.valueOf(1000));
    //Perform Test
    FilterType filter = delegate.not(spatialFilter1);
    //Verify
    assertThat(filter.getLogicOps().getName().toString(), is(LOGICAL_NOT_NAME));
    UnaryLogicOpType logicOpType = (UnaryLogicOpType) filter.getLogicOps().getValue();
    DistanceBufferType spatialOpsType1 = (DistanceBufferType) logicOpType.getSpatialOps().getValue();
    assertThat(Double.toString(spatialOpsType1.getDistance().getValue()), is(Double.valueOf(1000).toString()));
}
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

DistanceBufferType (net.opengis.filter.v_2_0_0.DistanceBufferType)9 FilterType (net.opengis.filter.v_2_0_0.FilterType)9 Test (org.junit.Test)9 DistanceBufferType (net.opengis.filter.v_1_1_0.DistanceBufferType)6 ArrayList (java.util.ArrayList)4 DistanceType (net.opengis.filter.v_1_1_0.DistanceType)3 PropertyNameType (net.opengis.filter.v_1_1_0.PropertyNameType)3 BinaryLogicOpType (net.opengis.filter.v_2_0_0.BinaryLogicOpType)3 UnaryLogicOpType (net.opengis.filter.v_2_0_0.UnaryLogicOpType)3 Geometry (com.vividsolutions.jts.geom.Geometry)2 Method (java.lang.reflect.Method)2 QueryImpl (ddf.catalog.operation.impl.QueryImpl)1 JAXBElement (javax.xml.bind.JAXBElement)1 QName (javax.xml.namespace.QName)1 GetRecordsType (net.opengis.cat.csw.v_2_0_2.GetRecordsType)1 QueryConstraintType (net.opengis.cat.csw.v_2_0_2.QueryConstraintType)1 QueryType (net.opengis.cat.csw.v_2_0_2.QueryType)1 FilterType (net.opengis.filter.v_1_1_0.FilterType)1 BinaryTemporalOpType (net.opengis.filter.v_2_0_0.BinaryTemporalOpType)1 PropertyIsLikeType (net.opengis.filter.v_2_0_0.PropertyIsLikeType)1