Search in sources :

Example 1 with SpatialOperator

use of org.n52.shetland.ogc.filter.FilterConstants.SpatialOperator 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)

Example 2 with SpatialOperator

use of org.n52.shetland.ogc.filter.FilterConstants.SpatialOperator in project arctic-sea by 52North.

the class SosV1GetCapabilitiesResponseEncoder method setSpatialFilterCapabilities.

/**
 * Sets the SpatialFilterCapabilities.
 *
 * !!! Modify method addicted to your implementation !!!
 *
 * @param spatialCapabilities SpatialCapabilities.
 * @param sosFilterCaps       the SOS filter capabilities
 */
protected void setSpatialFilterCapabilities(SpatialCapabilitiesType spatialCapabilities, org.n52.shetland.ogc.filter.FilterCapabilities sosFilterCaps) {
    // set GeometryOperands
    if (!sosFilterCaps.getSpatialOperands().isEmpty()) {
        sosFilterCaps.getSpatialOperands().forEach(spatialCapabilities.addNewGeometryOperands()::addGeometryOperand);
    }
    // set SpatialOperators
    if (!sosFilterCaps.getSpatialOperators().isEmpty()) {
        SpatialOperatorsType spatialOps = spatialCapabilities.addNewSpatialOperators();
        Set<SpatialOperator> keys = sosFilterCaps.getSpatialOperators().keySet();
        keys.forEach(spatialOperator -> {
            SpatialOperatorType operator = spatialOps.addNewSpatialOperator();
            operator.setName(getEnum4SpatialOperator(spatialOperator));
            GeometryOperandsType bboxGeomOps = operator.addNewGeometryOperands();
            sosFilterCaps.getSpatialOperators().get(spatialOperator).forEach(bboxGeomOps::addGeometryOperand);
        });
    }
}
Also used : SpatialOperatorsType(net.opengis.ogc.SpatialOperatorsType) SpatialOperatorType(net.opengis.ogc.SpatialOperatorType) GeometryOperandsType(net.opengis.ogc.GeometryOperandsType) SpatialOperator(org.n52.shetland.ogc.filter.FilterConstants.SpatialOperator)

Aggregations

SpatialOperator (org.n52.shetland.ogc.filter.FilterConstants.SpatialOperator)2 GeometryOperandsType (net.opengis.fes.x20.GeometryOperandsType)1 SpatialOperatorType (net.opengis.fes.x20.SpatialOperatorType)1 SpatialOperatorsType (net.opengis.fes.x20.SpatialOperatorsType)1 GeometryOperandsType (net.opengis.ogc.GeometryOperandsType)1 SpatialOperatorType (net.opengis.ogc.SpatialOperatorType)1 SpatialOperatorsType (net.opengis.ogc.SpatialOperatorsType)1