use of net.opengis.fes.x20.GeometryOperandsType in project ddf by codice.
the class CswEndpoint method buildFilterCapabilities.
/**
* Creates the Filter_Capabilities section of the GetCapabilities response. These are defined
* statically by the DDF FilterAdapter implementation TODO: If the implementation changes,
* update this method to reflect the changes.
*
* @return The constructed FilterCapabilities object
*/
private FilterCapabilities buildFilterCapabilities() {
// Create the FilterCapabilites - These are defined statically by the
// DDF FilterAdapter implementation
FilterCapabilities filterCapabilities = new FilterCapabilities();
ScalarCapabilitiesType scalarCapabilities = new ScalarCapabilitiesType();
ComparisonOperatorsType cot = new ComparisonOperatorsType();
cot.setComparisonOperator(COMPARISON_OPERATORS);
scalarCapabilities.setLogicalOperators(new LogicalOperators());
scalarCapabilities.setComparisonOperators(cot);
filterCapabilities.setScalarCapabilities(scalarCapabilities);
SpatialOperatorsType spatialOpsType = new SpatialOperatorsType();
ArrayList<SpatialOperatorType> spatialOpTypes = new ArrayList<>();
for (SpatialOperatorNameType sont : SPATIAL_OPERATORS) {
SpatialOperatorType sot = new SpatialOperatorType();
sot.setName(sont);
spatialOpTypes.add(sot);
}
GeometryOperandsType geometryOperands = new GeometryOperandsType();
List<QName> geoOperandsList = geometryOperands.getGeometryOperand();
geoOperandsList.add(new QName(CswConstants.GML_SCHEMA, CswConstants.GML_POINT, CswConstants.GML_NAMESPACE_PREFIX));
geoOperandsList.add(new QName(CswConstants.GML_SCHEMA, CswConstants.GML_LINESTRING, CswConstants.GML_NAMESPACE_PREFIX));
geoOperandsList.add(new QName(CswConstants.GML_SCHEMA, CswConstants.GML_POLYGON, CswConstants.GML_NAMESPACE_PREFIX));
spatialOpsType.setSpatialOperator(spatialOpTypes);
SpatialCapabilitiesType spatialCaps = new SpatialCapabilitiesType();
spatialCaps.setSpatialOperators(spatialOpsType);
spatialCaps.setGeometryOperands(geometryOperands);
filterCapabilities.setSpatialCapabilities(spatialCaps);
IdCapabilitiesType idCapabilities = new IdCapabilitiesType();
idCapabilities.getEIDOrFID().add(new EID());
filterCapabilities.setIdCapabilities(idCapabilities);
return filterCapabilities;
}
use of net.opengis.fes.x20.GeometryOperandsType in project ddf by codice.
the class TestCswFilterDelegate method getSpatialCapabilities.
private static SpatialCapabilitiesType getSpatialCapabilities(List<String> geometries) {
List<QName> mockGeometryOperands = new ArrayList<>();
String nameSpaceUri = "http://www.opengis.net/gml";
String prefix = "gml";
for (String geometry : geometries) {
QName polygonQName = new QName(nameSpaceUri, geometry, prefix);
mockGeometryOperands.add(polygonQName);
}
GeometryOperandsType mockGeometryOperandsType = mock(GeometryOperandsType.class);
when(mockGeometryOperandsType.getGeometryOperand()).thenReturn(mockGeometryOperands);
SpatialCapabilitiesType mockSpatialCapabilitiesType = mock(SpatialCapabilitiesType.class);
when(mockSpatialCapabilitiesType.getGeometryOperands()).thenReturn(mockGeometryOperandsType);
return mockSpatialCapabilitiesType;
}
use of net.opengis.fes.x20.GeometryOperandsType in project ddf by codice.
the class TestCswFilterDelegate method getAllSpatialCapabilities.
private static SpatialCapabilitiesType getAllSpatialCapabilities() {
List<QName> mockGeometryOperands = new ArrayList<QName>();
String nameSpaceUri = "http://www.opengis.net/gml";
String prefix = "gml";
QName polygonQName = new QName(nameSpaceUri, "Polygon", prefix);
mockGeometryOperands.add(polygonQName);
QName pointQName = new QName(nameSpaceUri, "Point", prefix);
mockGeometryOperands.add(pointQName);
QName lineStringQName = new QName(nameSpaceUri, "LineString", prefix);
mockGeometryOperands.add(lineStringQName);
QName multiPolygonQName = new QName(nameSpaceUri, "MultiPolygon", prefix);
mockGeometryOperands.add(multiPolygonQName);
QName multiPointQName = new QName(nameSpaceUri, "MultiPoint", prefix);
mockGeometryOperands.add(multiPointQName);
QName multiLineStringQName = new QName(nameSpaceUri, "MultiLineString", prefix);
mockGeometryOperands.add(multiLineStringQName);
QName envelopeQName = new QName(nameSpaceUri, "Envelope", prefix);
mockGeometryOperands.add(envelopeQName);
GeometryOperandsType mockGeometryOperandsType = mock(GeometryOperandsType.class);
when(mockGeometryOperandsType.getGeometryOperand()).thenReturn(mockGeometryOperands);
SpatialCapabilitiesType mockSpatialCapabilitiesType = mock(SpatialCapabilitiesType.class);
when(mockSpatialCapabilitiesType.getGeometryOperands()).thenReturn(mockGeometryOperandsType);
return mockSpatialCapabilitiesType;
}
use of net.opengis.fes.x20.GeometryOperandsType in project ddf by codice.
the class WfsFilterDelegate method updateAllowedOperations.
private final void updateAllowedOperations(FilterCapabilities filterCapabilities) {
comparisonOps = Collections.newSetFromMap(new ConcurrentHashMap<COMPARISON_OPERATORS, Boolean>(new EnumMap<COMPARISON_OPERATORS, Boolean>(COMPARISON_OPERATORS.class)));
geometryOperands = new ArrayList<QName>();
temporalOperands = new ArrayList<QName>();
if (filterCapabilities == null) {
LOGGER.debug("WFS 2.0 Service doesn't support any filters");
return;
}
// CONFORMANCE
configureConformance(filterCapabilities.getConformance());
ScalarCapabilitiesType scalarCapabilities = filterCapabilities.getScalarCapabilities();
if (scalarCapabilities != null) {
// LOGICAL OPERATORS
if (scalarCapabilities.getLogicalOperators() != null) {
logicalOps = true;
}
// COMPARISON OPERATORS
ComparisonOperatorsType comparisonOperators = scalarCapabilities.getComparisonOperators();
if (comparisonOperators != null) {
for (ComparisonOperatorType comp : comparisonOperators.getComparisonOperator()) {
if (null != comp) {
comparisonOps.add(COMPARISON_OPERATORS.valueOf(comp.getName()));
}
}
}
}
// SPATIAL OPERATORS
SpatialCapabilitiesType spatialCapabilities = filterCapabilities.getSpatialCapabilities();
if (spatialCapabilities != null) {
if (spatialCapabilities.getSpatialOperators() != null) {
setSpatialOps(spatialCapabilities.getSpatialOperators());
}
// GEOMETRY OPERANDS
GeometryOperandsType geometryOperandsType = spatialCapabilities.getGeometryOperands();
if (geometryOperandsType != null) {
for (GeometryOperandsType.GeometryOperand geoOperand : geometryOperandsType.getGeometryOperand()) {
if (geoOperand.getName() != null) {
geometryOperands.add(geoOperand.getName());
}
}
LOGGER.debug("geometryOperands: {}", geometryOperands);
}
}
// TEMPORAL OPERATORS
TemporalCapabilitiesType temporalCapabilitiesType = filterCapabilities.getTemporalCapabilities();
if (temporalCapabilitiesType != null) {
if (temporalCapabilitiesType.getTemporalOperators() != null) {
setTemporalOps(temporalCapabilitiesType.getTemporalOperators());
}
// TEMPORAL OPERANDS
TemporalOperandsType temporalOperandsType = temporalCapabilitiesType.getTemporalOperands();
if (temporalOperandsType != null) {
for (TemporalOperandsType.TemporalOperand temporalOperand : temporalOperandsType.getTemporalOperand()) {
if (temporalOperand.getName() != null) {
temporalOperands.add(temporalOperand.getName());
}
}
LOGGER.debug("temporalOperands: {}", temporalOperands);
}
}
}
use of net.opengis.fes.x20.GeometryOperandsType in project ddf by codice.
the class TestCswCqlFilter method getAllSpatialCapabilities.
private static SpatialCapabilitiesType getAllSpatialCapabilities() {
List<QName> mockGeometryOperands = new ArrayList<>();
String nameSpaceUri = "http://www.opengis.net/gml";
String prefix = "gml";
QName polygonQName = new QName(nameSpaceUri, "Polygon", prefix);
mockGeometryOperands.add(polygonQName);
QName pointQName = new QName(nameSpaceUri, "Point", prefix);
mockGeometryOperands.add(pointQName);
QName lineStringQName = new QName(nameSpaceUri, "LineString", prefix);
mockGeometryOperands.add(lineStringQName);
QName multiPolygonQName = new QName(nameSpaceUri, "MultiPolygon", prefix);
mockGeometryOperands.add(multiPolygonQName);
QName multiPointQName = new QName(nameSpaceUri, "MultiPoint", prefix);
mockGeometryOperands.add(multiPointQName);
QName multiLineStringQName = new QName(nameSpaceUri, "MultiLineString", prefix);
mockGeometryOperands.add(multiLineStringQName);
QName envelopeQName = new QName(nameSpaceUri, "Envelope", prefix);
mockGeometryOperands.add(envelopeQName);
GeometryOperandsType mockGeometryOperandsType = mock(GeometryOperandsType.class);
when(mockGeometryOperandsType.getGeometryOperand()).thenReturn(mockGeometryOperands);
SpatialCapabilitiesType mockSpatialCapabilitiesType = mock(SpatialCapabilitiesType.class);
when(mockSpatialCapabilitiesType.getGeometryOperands()).thenReturn(mockGeometryOperandsType);
return mockSpatialCapabilitiesType;
}
Aggregations