Search in sources :

Example 6 with QuantityType

use of net.opengis.swe.x20.QuantityType in project arctic-sea by 52North.

the class SweCommonEncoderv20 method createCoordinate.

private Coordinate createCoordinate(SweCoordinate<?> coordinate) throws EncodingException {
    Coordinate xbCoordinate = Coordinate.Factory.newInstance(getXmlOptions());
    xbCoordinate.setName(coordinate.getName());
    xbCoordinate.setQuantity((QuantityType) createAbstractDataComponent(coordinate.getValue(), EncodingContext.empty()));
    return xbCoordinate;
}
Also used : Coordinate(net.opengis.swe.x20.VectorType.Coordinate) SweCoordinate(org.n52.shetland.ogc.swe.SweCoordinate)

Example 7 with QuantityType

use of net.opengis.swe.x20.QuantityType in project arctic-sea by 52North.

the class SweCommonEncoderv20 method asDocument.

private XmlObject asDocument(AbstractDataComponentType type) throws NotYetSupportedEncodingException {
    if (type instanceof BooleanType) {
        BooleanDocument document = BooleanDocument.Factory.newInstance();
        document.setBoolean((BooleanType) type);
        return document;
    } else if (type instanceof CountType) {
        CountDocument document = CountDocument.Factory.newInstance();
        document.setCount((CountType) type);
        return document;
    } else if (type instanceof CountRangeType) {
        CountRangeDocument document = CountRangeDocument.Factory.newInstance();
        document.setCountRange((CountRangeType) type);
        return document;
    } else if (type instanceof QuantityType) {
        QuantityDocument document = QuantityDocument.Factory.newInstance();
        document.setQuantity((QuantityType) type);
        return document;
    } else if (type instanceof QuantityRangeType) {
        QuantityRangeDocument document = QuantityRangeDocument.Factory.newInstance();
        document.setQuantityRange((QuantityRangeType) type);
        return document;
    } else if (type instanceof TimeType) {
        TimeDocument document = TimeDocument.Factory.newInstance();
        document.setTime((TimeType) type);
        return document;
    } else if (type instanceof TimeRangeType) {
        TimeRangeDocument document = TimeRangeDocument.Factory.newInstance();
        document.setTimeRange((TimeRangeType) type);
        return document;
    } else if (type instanceof CategoryType) {
        CategoryDocument document = CategoryDocument.Factory.newInstance();
        document.setCategory((CategoryType) type);
        return document;
    } else if (type instanceof CategoryRangeType) {
        CategoryRangeDocument document = CategoryRangeDocument.Factory.newInstance();
        document.setCategoryRange((CategoryRangeType) type);
        return document;
    } else if (type instanceof MatrixType) {
        MatrixDocument document = MatrixDocument.Factory.newInstance();
        document.setMatrix((MatrixType) type);
        return document;
    } else if (type instanceof DataArrayType) {
        DataArrayDocument document = DataArrayDocument.Factory.newInstance();
        document.setDataArray1((DataArrayType) type);
        return document;
    } else if (type instanceof DataChoiceType) {
        DataChoiceDocument document = DataChoiceDocument.Factory.newInstance();
        document.setDataChoice((DataChoiceType) type);
        return document;
    } else if (type instanceof DataRecordType) {
        DataRecordDocument document = DataRecordDocument.Factory.newInstance();
        document.setDataRecord((DataRecordType) type);
        return document;
    } else if (type instanceof TextType) {
        TextDocument document = TextDocument.Factory.newInstance();
        document.setText((TextType) type);
        return document;
    } else if (type instanceof VectorType) {
        VectorDocument document = VectorDocument.Factory.newInstance();
        document.setVector((VectorType) type);
        return document;
    } else {
        throw new NotYetSupportedEncodingException(type.getClass().getName(), type);
    }
}
Also used : MatrixDocument(net.opengis.swe.x20.MatrixDocument) DataRecordType(net.opengis.swe.x20.DataRecordType) CategoryRangeType(net.opengis.swe.x20.CategoryRangeType) NotYetSupportedEncodingException(org.n52.svalbard.encode.exception.NotYetSupportedEncodingException) TimeRangeDocument(net.opengis.swe.x20.TimeRangeDocument) CategoryType(net.opengis.swe.x20.CategoryType) CountType(net.opengis.swe.x20.CountType) QuantityDocument(net.opengis.swe.x20.QuantityDocument) TimeType(net.opengis.swe.x20.TimeType) VectorDocument(net.opengis.swe.x20.VectorDocument) CountRangeType(net.opengis.swe.x20.CountRangeType) DataChoiceType(net.opengis.swe.x20.DataChoiceType) VectorType(net.opengis.swe.x20.VectorType) DataChoiceDocument(net.opengis.swe.x20.DataChoiceDocument) CountRangeDocument(net.opengis.swe.x20.CountRangeDocument) DataArrayType(net.opengis.swe.x20.DataArrayType) DataArrayDocument(net.opengis.swe.x20.DataArrayDocument) TextDocument(net.opengis.swe.x20.TextDocument) BooleanType(net.opengis.swe.x20.BooleanType) BooleanDocument(net.opengis.swe.x20.BooleanDocument) DataRecordDocument(net.opengis.swe.x20.DataRecordDocument) TextType(net.opengis.swe.x20.TextType) TimeRangeType(net.opengis.swe.x20.TimeRangeType) CategoryDocument(net.opengis.swe.x20.CategoryDocument) CategoryRangeDocument(net.opengis.swe.x20.CategoryRangeDocument) CountDocument(net.opengis.swe.x20.CountDocument) QuantityType(net.opengis.swe.x20.QuantityType) MatrixType(net.opengis.swe.x20.MatrixType) QuantityRangeDocument(net.opengis.swe.x20.QuantityRangeDocument) TimeDocument(net.opengis.swe.x20.TimeDocument) QuantityRangeType(net.opengis.swe.x20.QuantityRangeType)

Example 8 with QuantityType

use of net.opengis.swe.x20.QuantityType in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapValueQuantity.

private void mapValueQuantity(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        Double valueQuantity = source.getValueQuantity();
        String valueQuantityCode = source.getValueQuantityCode();
        if (StringUtils.isNotEmpty(valueQuantityCode) || valueQuantity != null) {
            QuantityType quantityType = new QuantityType();
            if (StringUtils.isNotEmpty(valueQuantityCode)) {
                quantityType.setUnitCode(valueQuantityCode);
            }
            if (valueQuantity != null) {
                quantityType.setValue(new BigDecimal(valueQuantity));
            }
            target.setValueQuantity(quantityType);
        }
    }
}
Also used : QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) BigDecimal(java.math.BigDecimal)

Example 9 with QuantityType

use of net.opengis.swe.x20.QuantityType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getGearCharacteristics.

public static GearCharacteristic getGearCharacteristics() {
    CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<TextType> descriptions = Arrays.asList(getTextType("This is sample text"));
    MeasureType valueMeasure = getMeasureType(123, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
    DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
    IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
    CodeType valueCode = getCodeType("Code type 1", "4fhry5-thfyr85-67thf-5htr84");
    TextType value = getTextType("This is sample Text");
    QuantityType valueQuantity = getQuantityType(123);
    List<FLUXLocation> specifiedFluxLocations = Arrays.asList(getFluxLocation());
    GearCharacteristic gearCharacteristic = new GearCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, value, valueQuantity, specifiedFluxLocations);
    return gearCharacteristic;
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) IndicatorType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) GearCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearCharacteristic) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 10 with QuantityType

use of net.opengis.swe.x20.QuantityType in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getGearProblem.

public static GearProblem getGearProblem() {
    CodeType typeCode = getCodeType("Code Type 1", "fhty58-gh586t-5tjf8-t58rjewe");
    QuantityType affectedQuantity = getQuantityType(222);
    List<CodeType> recoveryMeasureCodes = Arrays.asList(getCodeType("Quantity Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h"));
    List<FishingGear> relatedFishingGears = Arrays.asList(getFishingGear());
    GearProblem gearProblem = new GearProblem(typeCode, affectedQuantity, recoveryMeasureCodes, Arrays.asList(getFluxLocation()), relatedFishingGears);
    return gearProblem;
}
Also used : GearProblem(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearProblem) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Aggregations

QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)9 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)6 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)5 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)4 BigDecimal (java.math.BigDecimal)3 BooleanType (net.opengis.swe.x20.BooleanType)3 CategoryType (net.opengis.swe.x20.CategoryType)3 CountRangeType (net.opengis.swe.x20.CountRangeType)3 CountType (net.opengis.swe.x20.CountType)3 DataArrayType (net.opengis.swe.x20.DataArrayType)3 DataRecordType (net.opengis.swe.x20.DataRecordType)3 QuantityRangeType (net.opengis.swe.x20.QuantityRangeType)3 QuantityType (net.opengis.swe.x20.QuantityType)3 TextType (net.opengis.swe.x20.TextType)3 TimeRangeType (net.opengis.swe.x20.TimeRangeType)3 TimeType (net.opengis.swe.x20.TimeType)3 VectorType (net.opengis.swe.x20.VectorType)3 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)3 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)3 CategoryRangeType (net.opengis.swe.x20.CategoryRangeType)2