use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.
the class TestWfsFilterDelegate method testIntersectsWithEnvelope.
@Test
public void testIntersectsWithEnvelope() throws SAXException, IOException, JAXBException {
List<String> gmlProps = new ArrayList<>();
gmlProps.add(MOCK_GEOM);
when(mockFeatureMetacardType.getGmlProperties()).thenReturn(gmlProps);
when(mockFeatureMetacardType.getAttributeDescriptor(MOCK_GEOM)).thenReturn(new FeatureAttributeDescriptor(MOCK_GEOM, MOCK_GEOM, true, false, false, false, BasicTypes.STRING_TYPE));
SpatialOperatorType operator = new SpatialOperatorType();
operator.setName(SPATIAL_OPERATORS.Intersects.toString());
FilterCapabilities capabilities = MockWfsServer.getFilterCapabilities();
capabilities.getSpatialCapabilities().getSpatialOperators().getSpatialOperator().clear();
capabilities.getSpatialCapabilities().getSpatialOperators().getSpatialOperator().add(operator);
capabilities.getSpatialCapabilities().getGeometryOperands().getGeometryOperand().clear();
GeometryOperand geoOperand = new GeometryOperand();
geoOperand.setName(Wfs20Constants.ENVELOPE);
capabilities.getSpatialCapabilities().getGeometryOperands().getGeometryOperand().add(geoOperand);
WfsFilterDelegate delegate = new WfsFilterDelegate(mockFeatureMetacardType, capabilities, GeospatialUtil.EPSG_4326_URN, null, GeospatialUtil.LAT_LON_ORDER);
FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
assertTrue(filter.getSpatialOps().getValue() instanceof BinarySpatialOpType);
assertFalse(filter.isSetLogicOps());
assertXMLEqual(MockWfsServer.getIntersectsWithEnvelopeXmlFilter(), getXmlFromMarshaller(filter));
}
use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.
the class TestWfsFilterDelegate method testDisjointAsNotIntersects.
@Test
public void testDisjointAsNotIntersects() throws SAXException, IOException, JAXBException {
WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Intersects.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 BinarySpatialOpType);
assertXMLEqual(MockWfsServer.getNotIntersectsXmlFilter(), getXmlFromMarshaller(filter));
}
use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.
the class TestWfsFilterDelegate method testIntersects.
@Test
public void testIntersects() throws SAXException, IOException, JAXBException {
WfsFilterDelegate delegate = setupFilterDelegate(SPATIAL_OPERATORS.Intersects.toString());
FilterType filter = delegate.intersects(Metacard.ANY_GEO, POLYGON);
assertTrue(filter.getSpatialOps().getValue() instanceof BinarySpatialOpType);
assertFalse(filter.isSetLogicOps());
assertXMLEqual(MockWfsServer.getIntersectsXmlFilter(), getXmlFromMarshaller(filter));
}
use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.
the class CswQueryFactoryTest method testPostGetRecordsSpatialCrossesOgcFilter.
@Test
public void testPostGetRecordsSpatialCrossesOgcFilter() throws CswException, UnsupportedQueryException, SourceUnavailableException, FederationException {
BinarySpatialOpType op = createBinarySpatialOpType();
ogcSpatialQuery(Crosses.class, filterObjectFactory.createCrosses(op));
}
use of net.opengis.fes._2.BinarySpatialOpType in project ddf by codice.
the class CswFilterFactory method createBinarySpatialOpTypeUsingEnvelope.
private BinarySpatialOpType createBinarySpatialOpTypeUsingEnvelope(PropertyNameType propertyName, JAXBElement<EnvelopeType> envelope) {
BinarySpatialOpType binarySpatialOpType = new BinarySpatialOpType();
binarySpatialOpType.getPropertyName().add(propertyName);
binarySpatialOpType.setEnvelope(envelope);
return binarySpatialOpType;
}
Aggregations