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));
}
}
}
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);
});
}
}
Aggregations