use of net.opengis.swe.x101.EnvelopeType in project ddf by codice.
the class CswFilterFactory method createEnvelopeType.
private JAXBElement<EnvelopeType> createEnvelopeType(String wkt) {
EnvelopeType envelopeType = new EnvelopeType();
wkt = convertWktToLatLonOrdering(wkt);
Envelope envelope = getEnvelopeFromWkt(wkt);
if (envelope != null) {
envelopeType.setLowerCorner(createDirectPositionType(envelope.getMinX(), envelope.getMinY()));
envelopeType.setUpperCorner(createDirectPositionType(envelope.getMaxX(), envelope.getMaxY()));
}
return this.gmlObjectFactory.createEnvelope(envelopeType);
}
use of net.opengis.swe.x101.EnvelopeType in project ddf by codice.
the class CswFilterFactory method createBinarySpatialOpType.
private BinarySpatialOpType createBinarySpatialOpType(PropertyNameType propertyName, String wkt, BinarySpatialOperand geometryOrEnvelope) {
BinarySpatialOpType binarySpatialOpType = null;
if (geometryOrEnvelope == BinarySpatialOperand.GEOMETRY) {
wkt = convertWktToLatLonOrdering(wkt);
Geometry geometry = getGeometryFromWkt(wkt);
JAXBElement<? extends AbstractGeometryType> geometryJaxbElement = convertGeometry(geometry);
binarySpatialOpType = createBinarySpatialOpTypeUsingGeometry(propertyName, geometryJaxbElement);
} else {
JAXBElement<EnvelopeType> envelopeJaxbElement = createEnvelopeType(wkt);
binarySpatialOpType = createBinarySpatialOpTypeUsingEnvelope(propertyName, envelopeJaxbElement);
}
return binarySpatialOpType;
}
use of net.opengis.swe.x101.EnvelopeType in project ddf by codice.
the class CswFilterFactory method createBBoxType.
private JAXBElement<BBOXType> createBBoxType(String propertyName, String wkt) {
BBOXType bboxType = new BBOXType();
JAXBElement<EnvelopeType> envelope = createEnvelopeType(wkt);
bboxType.setEnvelope(envelope);
bboxType.setPropertyName(createPropertyNameType(propertyName));
return filterObjectFactory.createBBOX(bboxType);
}
use of net.opengis.swe.x101.EnvelopeType in project arctic-sea by 52North.
the class GmlEncoderv321 method createEnvelope.
private XmlObject createEnvelope(ReferencedEnvelope sosEnvelope) {
int srid = sosEnvelope.getSrid();
EnvelopeType envelopeType = EnvelopeType.Factory.newInstance();
MinMax<String> minmax = sosEnvelope.getMinMaxFromEnvelope();
envelopeType.addNewLowerCorner().setStringValue(minmax.getMinimum());
envelopeType.addNewUpperCorner().setStringValue(minmax.getMaximum());
envelopeType.setSrsName(getSrsName(srid));
return envelopeType;
}
use of net.opengis.swe.x101.EnvelopeType in project arctic-sea by 52North.
the class SweCommonEncoderv101 method createField.
private DataComponentPropertyType createField(SweField sweField) throws EncodingException {
SweAbstractDataComponent sosElement = sweField.getElement();
DataComponentPropertyType xbField = DataComponentPropertyType.Factory.newInstance(getXmlOptions());
if (sweField.isSetName()) {
xbField.setName(sweField.getName().getValue());
}
if (sosElement instanceof SweBoolean) {
xbField.addNewBoolean().set(createSimpleType((SweBoolean) sosElement));
} else if (sosElement instanceof SweCategory) {
xbField.addNewCategory().set(createSimpleType((SweCategory) sosElement));
} else if (sosElement instanceof SweCount) {
xbField.addNewCount().set(createSimpleType((SweCount) sosElement));
} else if (sosElement instanceof SweCountRange) {
xbField.addNewCount().set(createSimpleType((SweCountRange) sosElement));
} else if (sosElement instanceof SweQuantity) {
xbField.addNewQuantity().set(createSimpleType((SweQuantity) sosElement));
} else if (sosElement instanceof SweQuantityRange) {
xbField.addNewQuantity().set(createSimpleType((SweQuantityRange) sosElement));
} else if (sosElement instanceof SweText) {
xbField.addNewText().set(createSimpleType((SweText) sosElement));
} else if (sosElement instanceof SweTimeRange) {
xbField.addNewTimeRange().set(createSimpleType((SweTimeRange) sosElement));
} else if (sosElement instanceof SweTime) {
xbField.addNewTime().set(createSimpleType((SweTime) sosElement));
} else if (sosElement instanceof SweEnvelope) {
EnvelopeType xbEnvelope = (EnvelopeType) xbField.addNewAbstractDataRecord().substitute(SweConstants.QN_ENVELOPE_SWE_101, EnvelopeType.type);
xbEnvelope.set(createEnvelope((SweEnvelope) sosElement));
} else if (sosElement instanceof SweDataRecord) {
DataRecordType xbEnvelope = (DataRecordType) xbField.addNewAbstractDataRecord().substitute(SweConstants.QN_DATA_RECORD_SWE_101, DataRecordType.type);
xbEnvelope.set(createDataRecord((SweDataRecord) sosElement));
} else if (sosElement instanceof SweDataArray) {
DataArrayType xbEnvelope = (DataArrayType) xbField.addNewAbstractDataRecord().substitute(SweConstants.QN_DATA_RECORD_SWE_101, DataArrayType.type);
xbEnvelope.set(createDataArray((SweDataArray) sosElement).getDataArray1());
} else {
throw new EncodingException("The element type '%s' of the received '%s' is not supported by this encoder '%s'.", new Object[] { sosElement != null ? sosElement.getClass().getName() : null, sweField.getClass().getName(), getClass().getName() });
}
return xbField;
}
Aggregations