Search in sources :

Example 1 with GeometryOperandsType

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;
}
Also used : EID(net.opengis.filter.v_1_1_0.EID) QName(javax.xml.namespace.QName) SpatialOperatorType(net.opengis.filter.v_1_1_0.SpatialOperatorType) LogicalOperators(net.opengis.filter.v_1_1_0.LogicalOperators) ArrayList(java.util.ArrayList) SpatialOperatorNameType(net.opengis.filter.v_1_1_0.SpatialOperatorNameType) SpatialCapabilitiesType(net.opengis.filter.v_1_1_0.SpatialCapabilitiesType) FilterCapabilities(net.opengis.filter.v_1_1_0.FilterCapabilities) IdCapabilitiesType(net.opengis.filter.v_1_1_0.IdCapabilitiesType) ComparisonOperatorsType(net.opengis.filter.v_1_1_0.ComparisonOperatorsType) ScalarCapabilitiesType(net.opengis.filter.v_1_1_0.ScalarCapabilitiesType) SpatialOperatorsType(net.opengis.filter.v_1_1_0.SpatialOperatorsType) GeometryOperandsType(net.opengis.filter.v_1_1_0.GeometryOperandsType)

Example 2 with GeometryOperandsType

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;
}
Also used : QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) GeometryOperandsType(net.opengis.filter.v_1_1_0.GeometryOperandsType) SpatialCapabilitiesType(net.opengis.filter.v_1_1_0.SpatialCapabilitiesType)

Example 3 with GeometryOperandsType

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;
}
Also used : QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) GeometryOperandsType(net.opengis.filter.v_1_1_0.GeometryOperandsType) SpatialCapabilitiesType(net.opengis.filter.v_1_1_0.SpatialCapabilitiesType)

Example 4 with GeometryOperandsType

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);
        }
    }
}
Also used : TemporalCapabilitiesType(net.opengis.filter.v_2_0_0.TemporalCapabilitiesType) QName(javax.xml.namespace.QName) 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 5 with GeometryOperandsType

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;
}
Also used : QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) GeometryOperandsType(net.opengis.filter.v_1_1_0.GeometryOperandsType) SpatialCapabilitiesType(net.opengis.filter.v_1_1_0.SpatialCapabilitiesType)

Aggregations

QName (javax.xml.namespace.QName)7 GeometryOperandsType (net.opengis.filter.v_1_1_0.GeometryOperandsType)6 ArrayList (java.util.ArrayList)5 SpatialCapabilitiesType (net.opengis.filter.v_1_1_0.SpatialCapabilitiesType)5 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 ComparisonOperatorsType (net.opengis.filter.v_1_1_0.ComparisonOperatorsType)2 ScalarCapabilitiesType (net.opengis.filter.v_1_1_0.ScalarCapabilitiesType)2 SpatialOperatorType (net.opengis.filter.v_1_1_0.SpatialOperatorType)2 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 TemporalCapabilitiesType (net.opengis.filter.v_2_0_0.TemporalCapabilitiesType)2 TemporalOperandsType (net.opengis.filter.v_2_0_0.TemporalOperandsType)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 EnumMap (java.util.EnumMap)1 GeometryOperandsType (net.opengis.fes.x20.GeometryOperandsType)1