use of net.opengis.filter.v_2_0_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));
}
use of net.opengis.filter.v_2_0_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;
}
use of net.opengis.filter.v_2_0_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));
}
use of net.opengis.filter.v_2_0_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));
}
use of net.opengis.filter.v_2_0_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()));
}
Aggregations