use of net.opengis.ogc.impl.BBOXTypeImpl in project arctic-sea by 52North.
the class OgcDecoderv100 method parseSpatialOperatorType.
private Object parseSpatialOperatorType(BinarySpatialOpType xbSpatialOpsType) throws DecodingException {
SpatialFilter spatialFilter = new SpatialFilter();
try {
if (xbSpatialOpsType instanceof BBOXTypeImpl) {
spatialFilter.setOperator(FilterConstants.SpatialOperator.BBOX);
BBOXTypeImpl xbBBOX = (BBOXTypeImpl) xbSpatialOpsType;
spatialFilter.setOperator(FilterConstants.SpatialOperator.BBOX);
XmlCursor geometryCursor = xbBBOX.newCursor();
if (geometryCursor.toChild(GmlConstants.QN_ENVELOPE)) {
Object sosGeometry = decodeXmlElement(XmlObject.Factory.parse(geometryCursor.getDomNode()));
if (sosGeometry instanceof Geometry) {
spatialFilter.setGeometry((Geometry) sosGeometry);
}
} else {
throw unsupportedSpatialFilter();
}
geometryCursor.dispose();
} else {
throw unsupportedSpatialFilter();
}
} catch (XmlException xmle) {
throw errorParsingSpatialFilter(xmle);
}
return spatialFilter;
}
Aggregations