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