use of org.n52.shetland.ogc.swe.simpleType.SweQuantity in project arctic-sea by 52North.
the class SweCommonEncoderv101 method createSimpleType.
private AbstractDataComponentType createSimpleType(SweAbstractSimpleType<?> sosSimpleType, EncodingContext additionalValues) throws EncodingException {
AbstractDataComponentType abstractDataComponentType = null;
if (sosSimpleType instanceof SweBoolean) {
abstractDataComponentType = createBoolean((SweBoolean) sosSimpleType);
} else if (sosSimpleType instanceof SweCategory) {
abstractDataComponentType = createCategory((SweCategory) sosSimpleType);
} else if (sosSimpleType instanceof SweCount) {
abstractDataComponentType = createCount((SweCount) sosSimpleType);
} else if (sosSimpleType instanceof SweCountRange) {
abstractDataComponentType = createCountRange((SweCountRange) sosSimpleType);
} else if (sosSimpleType instanceof SweObservableProperty) {
abstractDataComponentType = createObservableProperty((SweObservableProperty) sosSimpleType);
} else if (sosSimpleType instanceof SweQuantity) {
abstractDataComponentType = createQuantity((SweQuantity) sosSimpleType);
} else if (sosSimpleType instanceof SweQuantityRange) {
abstractDataComponentType = createQuantityRange((SweQuantityRange) sosSimpleType);
} else if (sosSimpleType instanceof SweText) {
abstractDataComponentType = createText((SweText) sosSimpleType);
} else if (sosSimpleType instanceof SweTimeRange) {
abstractDataComponentType = createTimeRange((SweTimeRange) sosSimpleType);
} else if (sosSimpleType instanceof SweTime) {
abstractDataComponentType = createTime((SweTime) sosSimpleType);
} else {
throw new NotYetSupportedEncodingException(SweAbstractSimpleType.class.getSimpleName(), sosSimpleType);
}
addAbstractDataComponentValues(abstractDataComponentType, sosSimpleType);
return abstractDataComponentType;
}
use of org.n52.shetland.ogc.swe.simpleType.SweQuantity in project arctic-sea by 52North.
the class WmlTDREncoderv20 method createDataRecord.
/**
* Create a SOS DataRecord object from SOS observation and encode to
* XmlBeans object
*
* @param sosObservation
* SOS observation
* @return XML DataRecord object
* @throws EncodingException
* If an error occurs
*/
private XmlObject createDataRecord(OmObservation sosObservation) throws EncodingException {
AbstractPhenomenon observableProperty = sosObservation.getObservationConstellation().getObservableProperty();
SweQuantity quantity = new SweQuantity();
quantity.setDefinition(observableProperty.getIdentifier());
quantity.setDescription(observableProperty.getDescription());
if (observableProperty instanceof OmObservableProperty && ((OmObservableProperty) observableProperty).isSetUnit()) {
quantity.setUom(((OmObservableProperty) observableProperty).getUnit());
}
return createDataRecord(quantity, sosObservation.getObservationID());
}
Aggregations