Search in sources :

Example 1 with UomProperty

use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.

the class OMUtils method getDataRecordTrajectory.

public static AbstractDataRecord getDataRecordTrajectory(final String version, final List<? extends Field> phenomenons) {
    final List<AnyScalar> fields = new ArrayList<>();
    fields.add(TIME_FIELD.get(version));
    fields.add(LATITUDE_FIELD.get(version));
    fields.add(LONGITUDE_FIELD.get(version));
    for (Field phenomenon : phenomenons) {
        final UomProperty uom = SOSXmlFactory.buildUomProperty(version, phenomenon.uom, null);
        final Quantity cat = SOSXmlFactory.buildQuantity(version, phenomenon.name, uom, null);
        fields.add(SOSXmlFactory.buildAnyScalar(version, null, phenomenon.name, cat));
    }
    return SOSXmlFactory.buildSimpleDatarecord(version, null, null, null, true, fields);
}
Also used : Field(org.geotoolkit.observation.model.Field) ArrayList(java.util.ArrayList) Quantity(org.geotoolkit.swe.xml.Quantity) UomProperty(org.geotoolkit.swe.xml.UomProperty) AnyScalar(org.geotoolkit.swe.xml.AnyScalar)

Example 2 with UomProperty

use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.

the class OMUtils method getDataRecordProfile.

public static AbstractDataRecord getDataRecordProfile(final String version, final List<? extends Field> phenomenons) {
    final List<AnyScalar> fields = new ArrayList<>();
    fields.add(PRESSION_FIELD.get(version));
    for (Field phenomenon : phenomenons) {
        final UomProperty uom = SOSXmlFactory.buildUomProperty(version, phenomenon.uom, null);
        final Quantity cat = SOSXmlFactory.buildQuantity(version, phenomenon.name, uom, null);
        fields.add(SOSXmlFactory.buildAnyScalar(version, null, phenomenon.name, cat));
    }
    return SOSXmlFactory.buildSimpleDatarecord(version, null, null, null, true, fields);
}
Also used : Field(org.geotoolkit.observation.model.Field) ArrayList(java.util.ArrayList) Quantity(org.geotoolkit.swe.xml.Quantity) UomProperty(org.geotoolkit.swe.xml.UomProperty) AnyScalar(org.geotoolkit.swe.xml.AnyScalar)

Example 3 with UomProperty

use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.

the class OMUtils method getDataRecordTimeSeries.

public static AbstractDataRecord getDataRecordTimeSeries(final String version, final List<? extends Field> phenomenons) {
    final List<AnyScalar> fields = new ArrayList<>();
    fields.add(TIME_FIELD.get(version));
    for (Field phenomenon : phenomenons) {
        final UomProperty uom = SOSXmlFactory.buildUomProperty(version, phenomenon.uom, null);
        final Quantity cat = SOSXmlFactory.buildQuantity(version, phenomenon.name, uom, null);
        fields.add(SOSXmlFactory.buildAnyScalar(version, null, phenomenon.name, cat));
    }
    return SOSXmlFactory.buildSimpleDatarecord(version, null, null, null, true, fields);
}
Also used : Field(org.geotoolkit.observation.model.Field) ArrayList(java.util.ArrayList) Quantity(org.geotoolkit.swe.xml.Quantity) UomProperty(org.geotoolkit.swe.xml.UomProperty) AnyScalar(org.geotoolkit.swe.xml.AnyScalar)

Example 4 with UomProperty

use of org.geotoolkit.swe.xml.UomProperty in project geotoolkit by Geomatys.

the class Field method getScalar.

/**
 * Return an SWE object.
 *
 * @param version The SOS version of the object (and so the SWE version).
 * @return
 */
public AnyScalar getScalar(final String version) {
    final AbstractDataComponent compo;
    if (FieldType.QUANTITY.equals(type)) {
        final UomProperty uomCode = buildUomProperty(version, uom, null);
        compo = buildQuantity(version, description, uomCode, null);
    } else if (FieldType.TEXT.equals(type)) {
        compo = buildText(version, description, null);
    } else if (FieldType.TIME.equals(type)) {
        compo = buildTime(version, description, null);
    } else if (FieldType.BOOLEAN.equals(type)) {
        compo = buildBoolean(version, description, null);
    } else {
        throw new IllegalArgumentException("Unexpected field Type:" + type);
    }
    return buildAnyScalar(version, null, name, compo);
}
Also used : AbstractDataComponent(org.geotoolkit.swe.xml.AbstractDataComponent) UomProperty(org.geotoolkit.swe.xml.UomProperty)

Aggregations

UomProperty (org.geotoolkit.swe.xml.UomProperty)4 ArrayList (java.util.ArrayList)3 Field (org.geotoolkit.observation.model.Field)3 AnyScalar (org.geotoolkit.swe.xml.AnyScalar)3 Quantity (org.geotoolkit.swe.xml.Quantity)3 AbstractDataComponent (org.geotoolkit.swe.xml.AbstractDataComponent)1