Search in sources :

Example 16 with SpatialOperatorType

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

the class TestCswCqlFilter method getSpatialOperatorsList.

private static List<SpatialOperatorType> getSpatialOperatorsList() {
    List<SpatialOperatorType> spatialOperatorList = new ArrayList<>();
    SpatialOperatorType intersectsSpatialOperator = new SpatialOperatorType();
    intersectsSpatialOperator.setName(SpatialOperatorNameType.INTERSECTS);
    spatialOperatorList.add(intersectsSpatialOperator);
    SpatialOperatorType bboxSpatialOperator = new SpatialOperatorType();
    bboxSpatialOperator.setName(SpatialOperatorNameType.BBOX);
    spatialOperatorList.add(bboxSpatialOperator);
    SpatialOperatorType crossesSpatialOperator = new SpatialOperatorType();
    crossesSpatialOperator.setName(SpatialOperatorNameType.CROSSES);
    spatialOperatorList.add(crossesSpatialOperator);
    SpatialOperatorType withinSpatialOperator = new SpatialOperatorType();
    withinSpatialOperator.setName(SpatialOperatorNameType.WITHIN);
    spatialOperatorList.add(withinSpatialOperator);
    SpatialOperatorType containsSpatialOperator = new SpatialOperatorType();
    containsSpatialOperator.setName(SpatialOperatorNameType.CONTAINS);
    spatialOperatorList.add(containsSpatialOperator);
    SpatialOperatorType beyondSpatialOperator = new SpatialOperatorType();
    beyondSpatialOperator.setName(SpatialOperatorNameType.BEYOND);
    spatialOperatorList.add(beyondSpatialOperator);
    SpatialOperatorType dwithinSpatialOperator = new SpatialOperatorType();
    dwithinSpatialOperator.setName(SpatialOperatorNameType.D_WITHIN);
    spatialOperatorList.add(dwithinSpatialOperator);
    SpatialOperatorType disjointSpatialOperator = new SpatialOperatorType();
    disjointSpatialOperator.setName(SpatialOperatorNameType.DISJOINT);
    spatialOperatorList.add(disjointSpatialOperator);
    SpatialOperatorType overlapsSpatialOperator = new SpatialOperatorType();
    overlapsSpatialOperator.setName(SpatialOperatorNameType.OVERLAPS);
    spatialOperatorList.add(overlapsSpatialOperator);
    SpatialOperatorType touchesSpatialOperator = new SpatialOperatorType();
    touchesSpatialOperator.setName(SpatialOperatorNameType.TOUCHES);
    spatialOperatorList.add(touchesSpatialOperator);
    return spatialOperatorList;
}
Also used : SpatialOperatorType(net.opengis.filter.v_1_1_0.SpatialOperatorType) ArrayList(java.util.ArrayList)

Example 17 with SpatialOperatorType

use of net.opengis.fes.x20.SpatialOperatorType in project arctic-sea by 52North.

the class FesEncoderv20 method setSpatialFilterCapabilities.

/**
 * Sets the SpatialFilterCapabilities.
 *
 * @param spatialCapabilitiesType FES SpatialCapabilities.
 * @param sosFilterCaps SOS spatial filter information
 *
 * @throws EncodingException if the spatial operator is not supported
 */
private void setSpatialFilterCapabilities(final SpatialCapabilitiesType spatialCapabilitiesType, org.n52.shetland.ogc.filter.FilterCapabilities sosFilterCaps) throws EncodingException {
    // set GeometryOperands
    if (sosFilterCaps.getSpatialOperands() != null && !sosFilterCaps.getSpatialOperands().isEmpty()) {
        GeometryOperandsType spatialOperands = spatialCapabilitiesType.addNewGeometryOperands();
        sosFilterCaps.getSpatialOperands().forEach(operand -> spatialOperands.addNewGeometryOperand().setName(operand));
    }
    // set SpatialOperators
    if (sosFilterCaps.getSpatialOperators() != null && !sosFilterCaps.getSpatialOperators().isEmpty()) {
        SpatialOperatorsType spatialOps = spatialCapabilitiesType.addNewSpatialOperators();
        Set<SpatialOperator> keys = sosFilterCaps.getSpatialOperators().keySet();
        for (SpatialOperator spatialOperator : keys) {
            SpatialOperatorType operator = spatialOps.addNewSpatialOperator();
            operator.setName(getEnum4SpatialOperator(spatialOperator));
            GeometryOperandsType geomOps = operator.addNewGeometryOperands();
            sosFilterCaps.getSpatialOperators().get(spatialOperator).forEach(operand -> geomOps.addNewGeometryOperand().setName(operand));
        }
    }
}
Also used : SpatialOperatorsType(net.opengis.fes.x20.SpatialOperatorsType) SpatialOperatorType(net.opengis.fes.x20.SpatialOperatorType) GeometryOperandsType(net.opengis.fes.x20.GeometryOperandsType) SpatialOperator(org.n52.shetland.ogc.filter.FilterConstants.SpatialOperator)

Aggregations

ArrayList (java.util.ArrayList)11 SpatialOperatorType (net.opengis.filter.v_1_1_0.SpatialOperatorType)8 SpatialOperatorType (net.opengis.filter.v_2_0_0.SpatialOperatorType)8 FilterCapabilities (net.opengis.filter.v_2_0_0.FilterCapabilities)6 FeatureAttributeDescriptor (org.codice.ddf.spatial.ogc.wfs.catalog.common.FeatureAttributeDescriptor)5 FilterType (net.opengis.filter.v_2_0_0.FilterType)4 QName (javax.xml.namespace.QName)3 FilterCapabilities (net.opengis.filter.v_1_1_0.FilterCapabilities)3 SpatialOperatorNameType (net.opengis.filter.v_1_1_0.SpatialOperatorNameType)3 SpatialOperatorsType (net.opengis.filter.v_1_1_0.SpatialOperatorsType)3 BinarySpatialOpType (net.opengis.filter.v_2_0_0.BinarySpatialOpType)3 GeometryOperand (net.opengis.filter.v_2_0_0.GeometryOperandsType.GeometryOperand)3 EnumMap (java.util.EnumMap)2 ComparisonOperatorsType (net.opengis.filter.v_1_1_0.ComparisonOperatorsType)2 GeometryOperandsType (net.opengis.filter.v_1_1_0.GeometryOperandsType)2 LogicalOperators (net.opengis.filter.v_1_1_0.LogicalOperators)2 ScalarCapabilitiesType (net.opengis.filter.v_1_1_0.ScalarCapabilitiesType)2 SpatialCapabilitiesType (net.opengis.filter.v_1_1_0.SpatialCapabilitiesType)2 SpatialOperatorsType (net.opengis.filter.v_2_0_0.SpatialOperatorsType)2 SPATIAL_OPERATORS (org.codice.ddf.spatial.ogc.wfs.v2_0_0.catalog.common.Wfs20Constants.SPATIAL_OPERATORS)2