use of net.opengis.swe.x20.DataStreamType.ElementType in project arctic-sea by 52North.
the class SweCommonDecoderV20 method parseDataStream.
private SweDataStream parseDataStream(DataStreamType dataStream) throws DecodingException {
SweDataStream sweDataStream = new SweDataStream();
if (dataStream.isSetElementCount() && dataStream.getElementCount().getCount() != null) {
sweDataStream.setElementCount(parseCount(dataStream.getElementCount().getCount()));
}
// parse data record to elementType
ElementType xbElementType = dataStream.getElementType();
if (xbElementType != null && xbElementType.getAbstractDataComponent() != null) {
sweDataStream.setElementType(parseAbstractDataComponent(xbElementType.getAbstractDataComponent()));
}
if (dataStream.getEncoding() != null && dataStream.getEncoding().getAbstractEncoding() != null) {
sweDataStream.setEncoding(parseEncoding(dataStream.getEncoding().getAbstractEncoding()));
}
// parse values
if (dataStream.getValues() != null) {
sweDataStream.setValues(parseValues(sweDataStream.getElementCount(), sweDataStream.getElementType(), sweDataStream.getEncoding(), dataStream.getValues()));
}
// set XML
DataStreamDocument dataStreamDoc = DataStreamDocument.Factory.newInstance(getXmlOptions());
dataStreamDoc.setDataStream(dataStream);
sweDataStream.setXml(dataStreamDoc.xmlText(getXmlOptions()));
return sweDataStream;
}
use of net.opengis.swe.x20.DataStreamType.ElementType in project arctic-sea by 52North.
the class SweCommonDecoderV20 method parseDataArray.
private SweDataArray parseDataArray(DataArrayType xbDataArray) throws DecodingException {
SweDataArray sosSweDataArray = new SweDataArray();
CountPropertyType elementCount = xbDataArray.getElementCount();
if (elementCount != null) {
sosSweDataArray.setElementCount(parseElementCount(elementCount));
}
// parse data record to elementType
DataArrayType.ElementType xbElementType = xbDataArray.getElementType();
if (xbElementType != null && xbElementType.getAbstractDataComponent() != null) {
sosSweDataArray.setElementType(parseAbstractDataComponent(xbElementType.getAbstractDataComponent()));
}
if (xbDataArray.isSetEncoding()) {
sosSweDataArray.setEncoding(parseEncoding(xbDataArray.getEncoding().getAbstractEncoding()));
}
// parse values
if (xbDataArray.isSetValues()) {
sosSweDataArray.setValues(parseValues(sosSweDataArray.getElementCount(), sosSweDataArray.getElementType(), sosSweDataArray.getEncoding(), xbDataArray.getValues()));
}
// set XML
DataArrayDocument dataArrayDoc = DataArrayDocument.Factory.newInstance(getXmlOptions());
dataArrayDoc.setDataArray1(xbDataArray);
sosSweDataArray.setXml(dataArrayDoc.xmlText(getXmlOptions()));
return sosSweDataArray;
}
Aggregations