use of net.opengis.filter.v_1_1_0.LogicalOperators 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.filter.v_1_1_0.LogicalOperators in project ddf by codice.
the class MockWfsServer method getFilterCapabilities.
public static FilterCapabilities getFilterCapabilities() {
FilterCapabilities capabilities = new FilterCapabilities();
ConformanceType conformance = new ConformanceType();
for (CONFORMANCE_CONSTRAINTS constraint : CONFORMANCE_CONSTRAINTS.values()) {
DomainType domain = new DomainType();
NoValues noValues = new NoValues();
domain.setNoValues(noValues);
ValueType value = new ValueType();
value.setValue("TRUE");
domain.setDefaultValue(value);
domain.setName(constraint.toString());
conformance.getConstraint().add(domain);
}
capabilities.setConformance(conformance);
ScalarCapabilitiesType scalar = new ScalarCapabilitiesType();
scalar.setLogicalOperators(new LogicalOperators());
scalar.setComparisonOperators(new ComparisonOperatorsType());
for (COMPARISON_OPERATORS compOp : COMPARISON_OPERATORS.values()) {
ComparisonOperatorType operator = new ComparisonOperatorType();
operator.setName(compOp.toString());
scalar.getComparisonOperators().getComparisonOperator().add(operator);
}
capabilities.setScalarCapabilities(scalar);
SpatialCapabilitiesType spatial = new SpatialCapabilitiesType();
spatial.setSpatialOperators(new SpatialOperatorsType());
for (SPATIAL_OPERATORS spatialOp : SPATIAL_OPERATORS.values()) {
SpatialOperatorType operator = new SpatialOperatorType();
operator.setName(spatialOp.toString());
spatial.getSpatialOperators().getSpatialOperator().add(operator);
}
GeometryOperandsType geometryOperands = new GeometryOperandsType();
List<QName> qnames = Arrays.asList(Wfs20Constants.POINT, Wfs20Constants.ENVELOPE, Wfs20Constants.POLYGON, Wfs20Constants.LINESTRING);
for (QName qName : qnames) {
GeometryOperand operand = new GeometryOperand();
operand.setName(qName);
geometryOperands.getGeometryOperand().add(operand);
}
spatial.setGeometryOperands(geometryOperands);
capabilities.setSpatialCapabilities(spatial);
TemporalCapabilitiesType temporal = new TemporalCapabilitiesType();
temporal.setTemporalOperators(new TemporalOperatorsType());
for (TEMPORAL_OPERATORS temporalOp : TEMPORAL_OPERATORS.values()) {
TemporalOperatorType operator = new TemporalOperatorType();
operator.setName(temporalOp.toString());
temporal.getTemporalOperators().getTemporalOperator().add(operator);
}
TemporalOperandsType temporalOperands = new TemporalOperandsType();
List<QName> timeQNames = Arrays.asList(new QName(Wfs20Constants.GML_3_2_NAMESPACE, "TimePeriod"), new QName(Wfs20Constants.GML_3_2_NAMESPACE, "TimeInstant"));
for (QName qName : timeQNames) {
TemporalOperand operand = new TemporalOperand();
operand.setName(qName);
temporalOperands.getTemporalOperand().add(operand);
}
temporal.setTemporalOperands(temporalOperands);
capabilities.setTemporalCapabilities(temporal);
return capabilities;
}
Aggregations