use of net.opengis.fes.x20.TemporalOperatorType in project ddf by codice.
the class TestWfsFilterDelegate method setupFilterCapabilities.
private FilterCapabilities setupFilterCapabilities() {
FilterCapabilities filterCapabilities = new FilterCapabilities();
TemporalCapabilitiesType temporal = new TemporalCapabilitiesType();
temporal.setTemporalOperators(new TemporalOperatorsType());
TemporalOperatorType duringOperator = new TemporalOperatorType();
duringOperator.setName(TEMPORAL_OPERATORS.During.name());
temporal.getTemporalOperators().getTemporalOperator().add(duringOperator);
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) {
TemporalOperandsType.TemporalOperand operand = new TemporalOperandsType.TemporalOperand();
operand.setName(qName);
temporalOperands.getTemporalOperand().add(operand);
}
temporal.setTemporalOperands(temporalOperands);
filterCapabilities.setTemporalCapabilities(temporal);
return filterCapabilities;
}
use of net.opengis.fes.x20.TemporalOperatorType in project arctic-sea by 52North.
the class FesEncoderv20 method setTemporalFilterCapabilities.
/**
* Sets the TemporalFilterCapabilities.
*
* @param temporalCapabilitiesType FES TemporalCapabilities.
* @param sosFilterCaps SOS temporal filter information
*
* @throws org.n52.svalbard.encode.exception.EncodingException if one of the temporal operators is not supported
*/
private void setTemporalFilterCapabilities(TemporalCapabilitiesType temporalCapabilitiesType, org.n52.shetland.ogc.filter.FilterCapabilities sosFilterCaps) throws EncodingException {
// set TemporalOperands
if (sosFilterCaps.getTemporalOperands() != null && !sosFilterCaps.getTemporalOperands().isEmpty()) {
TemporalOperandsType tempOperands = temporalCapabilitiesType.addNewTemporalOperands();
sosFilterCaps.getTemporalOperands().forEach(operand -> tempOperands.addNewTemporalOperand().setName(operand));
}
// set TemporalOperators
if (sosFilterCaps.getTemporalOperators() != null && !sosFilterCaps.getTemporalOperators().isEmpty()) {
TemporalOperatorsType temporalOps = temporalCapabilitiesType.addNewTemporalOperators();
Set<TimeOperator> keys = sosFilterCaps.getTemporalOperators().keySet();
for (TimeOperator temporalOperator : keys) {
TemporalOperatorType operator = temporalOps.addNewTemporalOperator();
operator.setName(getEnum4TemporalOperator(temporalOperator));
TemporalOperandsType bboxGeomOps = operator.addNewTemporalOperands();
sosFilterCaps.getTemporalOperators().get(temporalOperator).forEach(operand -> bboxGeomOps.addNewTemporalOperand().setName(operand));
}
}
}
use of net.opengis.fes.x20.TemporalOperatorType 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;
}
use of net.opengis.fes.x20.TemporalOperatorType in project ddf by codice.
the class WfsFilterDelegate method setTemporalOps.
public void setTemporalOps(TemporalOperatorsType temporalOperators) {
temporalOps = new ConcurrentHashMap<TEMPORAL_OPERATORS, TemporalOperatorType>(new EnumMap<TEMPORAL_OPERATORS, TemporalOperatorType>(TEMPORAL_OPERATORS.class));
for (TemporalOperatorType temporalOp : temporalOperators.getTemporalOperator()) {
LOGGER.debug("Adding key [temporalOp Name: {}]", temporalOp.getName());
temporalOps.put(TEMPORAL_OPERATORS.valueOf(temporalOp.getName()), temporalOp);
LOGGER.debug("temporalOps Map: {}", temporalOps.toString());
}
}
Aggregations