Search in sources :

Example 1 with TemporalOperandsType

use of net.opengis.fes.x20.TemporalOperandsType 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;
}
Also used : TemporalCapabilitiesType(net.opengis.filter.v_2_0_0.TemporalCapabilitiesType) FilterCapabilities(net.opengis.filter.v_2_0_0.FilterCapabilities) TemporalOperatorType(net.opengis.filter.v_2_0_0.TemporalOperatorType) QName(javax.xml.namespace.QName) TemporalOperatorsType(net.opengis.filter.v_2_0_0.TemporalOperatorsType) TemporalOperandsType(net.opengis.filter.v_2_0_0.TemporalOperandsType)

Example 2 with TemporalOperandsType

use of net.opengis.fes.x20.TemporalOperandsType 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));
        }
    }
}
Also used : TimeOperator(org.n52.shetland.ogc.filter.FilterConstants.TimeOperator) TemporalOperatorType(net.opengis.fes.x20.TemporalOperatorType) TemporalOperatorsType(net.opengis.fes.x20.TemporalOperatorsType) TemporalOperandsType(net.opengis.fes.x20.TemporalOperandsType)

Example 3 with TemporalOperandsType

use of net.opengis.fes.x20.TemporalOperandsType in project ddf by codice.

the class WfsFilterDelegate method updateAllowedOperations.

private void updateAllowedOperations(FilterCapabilities filterCapabilities) {
    comparisonOps = Collections.newSetFromMap(new ConcurrentHashMap<>(new EnumMap<>(COMPARISON_OPERATORS.class)));
    geometryOperands = new ArrayList<>();
    temporalOperands = new ArrayList<>();
    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.getEnum(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);
        }
    }
}
Also used : TemporalCapabilitiesType(net.opengis.filter.v_2_0_0.TemporalCapabilitiesType) SpatialCapabilitiesType(net.opengis.filter.v_2_0_0.SpatialCapabilitiesType) ComparisonOperatorsType(net.opengis.filter.v_2_0_0.ComparisonOperatorsType) ScalarCapabilitiesType(net.opengis.filter.v_2_0_0.ScalarCapabilitiesType) GeometryOperandsType(net.opengis.filter.v_2_0_0.GeometryOperandsType) ComparisonOperatorType(net.opengis.filter.v_2_0_0.ComparisonOperatorType) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) COMPARISON_OPERATORS(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.COMPARISON_OPERATORS) GeometryOperand(net.opengis.filter.v_2_0_0.GeometryOperandsType.GeometryOperand) TemporalOperandsType(net.opengis.filter.v_2_0_0.TemporalOperandsType) TemporalOperand(net.opengis.filter.v_2_0_0.TemporalOperandsType.TemporalOperand)

Example 4 with TemporalOperandsType

use of net.opengis.fes.x20.TemporalOperandsType 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;
}
Also used : SpatialCapabilitiesType(net.opengis.filter.v_2_0_0.SpatialCapabilitiesType) FilterCapabilities(net.opengis.filter.v_2_0_0.FilterCapabilities) DomainType(net.opengis.ows.v_1_1_0.DomainType) SpatialOperatorsType(net.opengis.filter.v_2_0_0.SpatialOperatorsType) GeometryOperandsType(net.opengis.filter.v_2_0_0.GeometryOperandsType) TemporalOperatorsType(net.opengis.filter.v_2_0_0.TemporalOperatorsType) NoValues(net.opengis.ows.v_1_1_0.NoValues) ComparisonOperatorType(net.opengis.filter.v_2_0_0.ComparisonOperatorType) TemporalOperand(net.opengis.filter.v_2_0_0.TemporalOperandsType.TemporalOperand) ConformanceType(net.opengis.filter.v_2_0_0.ConformanceType) COMPARISON_OPERATORS(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.COMPARISON_OPERATORS) TemporalCapabilitiesType(net.opengis.filter.v_2_0_0.TemporalCapabilitiesType) SPATIAL_OPERATORS(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.SPATIAL_OPERATORS) ValueType(net.opengis.ows.v_1_1_0.ValueType) QName(javax.xml.namespace.QName) SpatialOperatorType(net.opengis.filter.v_2_0_0.SpatialOperatorType) TEMPORAL_OPERATORS(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.TEMPORAL_OPERATORS) LogicalOperators(net.opengis.filter.v_2_0_0.LogicalOperators) GeometryOperand(net.opengis.filter.v_2_0_0.GeometryOperandsType.GeometryOperand) CONFORMANCE_CONSTRAINTS(org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.CONFORMANCE_CONSTRAINTS) ComparisonOperatorsType(net.opengis.filter.v_2_0_0.ComparisonOperatorsType) ScalarCapabilitiesType(net.opengis.filter.v_2_0_0.ScalarCapabilitiesType) TemporalOperatorType(net.opengis.filter.v_2_0_0.TemporalOperatorType) TemporalOperandsType(net.opengis.filter.v_2_0_0.TemporalOperandsType)

Example 5 with TemporalOperandsType

use of net.opengis.fes.x20.TemporalOperandsType in project ddf by codice.

the class WfsFilterDelegateTest 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.getValue());
    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;
}
Also used : TemporalCapabilitiesType(net.opengis.filter.v_2_0_0.TemporalCapabilitiesType) FilterCapabilities(net.opengis.filter.v_2_0_0.FilterCapabilities) TemporalOperatorType(net.opengis.filter.v_2_0_0.TemporalOperatorType) QName(javax.xml.namespace.QName) TemporalOperatorsType(net.opengis.filter.v_2_0_0.TemporalOperatorsType) TemporalOperandsType(net.opengis.filter.v_2_0_0.TemporalOperandsType)

Aggregations

TemporalCapabilitiesType (net.opengis.filter.v_2_0_0.TemporalCapabilitiesType)4 TemporalOperandsType (net.opengis.filter.v_2_0_0.TemporalOperandsType)4 QName (javax.xml.namespace.QName)3 FilterCapabilities (net.opengis.filter.v_2_0_0.FilterCapabilities)3 TemporalOperatorType (net.opengis.filter.v_2_0_0.TemporalOperatorType)3 TemporalOperatorsType (net.opengis.filter.v_2_0_0.TemporalOperatorsType)3 ComparisonOperatorType (net.opengis.filter.v_2_0_0.ComparisonOperatorType)2 ComparisonOperatorsType (net.opengis.filter.v_2_0_0.ComparisonOperatorsType)2 GeometryOperandsType (net.opengis.filter.v_2_0_0.GeometryOperandsType)2 GeometryOperand (net.opengis.filter.v_2_0_0.GeometryOperandsType.GeometryOperand)2 ScalarCapabilitiesType (net.opengis.filter.v_2_0_0.ScalarCapabilitiesType)2 SpatialCapabilitiesType (net.opengis.filter.v_2_0_0.SpatialCapabilitiesType)2 TemporalOperand (net.opengis.filter.v_2_0_0.TemporalOperandsType.TemporalOperand)2 COMPARISON_OPERATORS (org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.COMPARISON_OPERATORS)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 TemporalOperandsType (net.opengis.fes.x20.TemporalOperandsType)1 TemporalOperatorType (net.opengis.fes.x20.TemporalOperatorType)1 TemporalOperatorsType (net.opengis.fes.x20.TemporalOperatorsType)1 ConformanceType (net.opengis.filter.v_2_0_0.ConformanceType)1 LogicalOperators (net.opengis.filter.v_2_0_0.LogicalOperators)1