Search in sources :

Example 21 with SweAbstractDataComponent

use of org.n52.shetland.ogc.swe.SweAbstractDataComponent in project arctic-sea by 52North.

the class FieldDecoder method decodeCountRange.

protected SweAbstractDataComponent decodeCountRange(JsonNode node) {
    SweCountRange swe = new SweCountRange();
    if (node.hasNonNull(JSONConstants.VALUE)) {
        int start = node.path(JSONConstants.VALUE).path(0).intValue();
        int end = node.path(JSONConstants.VALUE).path(1).intValue();
        swe.setValue(new RangeValue<Integer>(start, end));
    }
    return swe;
}
Also used : SweCountRange(org.n52.shetland.ogc.swe.simpleType.SweCountRange)

Example 22 with SweAbstractDataComponent

use of org.n52.shetland.ogc.swe.SweAbstractDataComponent in project arctic-sea by 52North.

the class SweAbstractDataComponent method setName.

public SweAbstractDataComponent setName(final String name) {
    getNames().clear();
    getNames().add(new CodeType(name));
    return this;
}
Also used : CodeType(org.n52.shetland.ogc.gml.CodeType)

Example 23 with SweAbstractDataComponent

use of org.n52.shetland.ogc.swe.SweAbstractDataComponent in project arctic-sea by 52North.

the class ProfileLevel method valueAsDataRecord.

public SweDataRecord valueAsDataRecord(SweDataRecord dataRecord) {
    int counter = 0;
    for (Value<?> v : getValue()) {
        if (v instanceof SweAbstractDataComponent) {
            SweAbstractDataComponent adc = (SweAbstractDataComponent) v;
            String name;
            if (adc.isSetName()) {
                name = adc.getName().getValue();
            } else if (adc.isSetDefinition()) {
                name = adc.getDefinition();
            } else {
                name = "component_" + counter++;
            }
            dataRecord.addField(new SweField(name, adc));
        }
    }
    return dataRecord;
}
Also used : SweField(org.n52.shetland.ogc.swe.SweField) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent)

Example 24 with SweAbstractDataComponent

use of org.n52.shetland.ogc.swe.SweAbstractDataComponent in project arctic-sea by 52North.

the class AbstractSmlDataComponentContainer method getDataRecord.

/**
 * @return the dataRecord
 */
public DataRecord getDataRecord() {
    if (!isSetDataRecord() && isSetDataComponents()) {
        SweSimpleDataRecord sdr = new SweSimpleDataRecord();
        int counter = 1;
        for (SweAbstractDataComponent element : abstractDataComponents) {
            String n = "field_" + counter++;
            if (element.isSetName()) {
                n = element.getName().getValue();
            }
            SweField field = new SweField(n, element);
            sdr.addField(field);
        }
        return sdr;
    }
    return dataRecord;
}
Also used : SweSimpleDataRecord(org.n52.shetland.ogc.swe.SweSimpleDataRecord) SweField(org.n52.shetland.ogc.swe.SweField) SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent)

Example 25 with SweAbstractDataComponent

use of org.n52.shetland.ogc.swe.SweAbstractDataComponent in project arctic-sea by 52North.

the class SmlCharacteristics method getCharacteristic.

/**
 * @return the characteristics
 */
public List<SmlCharacteristic> getCharacteristic() {
    if (!hasCharacteristics() && isSetAbstractDataComponents()) {
        List<SmlCharacteristic> c = Lists.newArrayList();
        for (SweAbstractDataComponent component : getAbstractDataComponents()) {
            SmlCharacteristic smlCharacteristic = new SmlCharacteristic(component.getName().getValue());
            smlCharacteristic.setAbstractDataComponent(component);
            c.add(smlCharacteristic);
        }
        return c;
    }
    return this.characteristics;
}
Also used : SweAbstractDataComponent(org.n52.shetland.ogc.swe.SweAbstractDataComponent)

Aggregations

SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)24 XmlObject (org.apache.xmlbeans.XmlObject)11 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)8 SweField (org.n52.shetland.ogc.swe.SweField)7 ArrayList (java.util.ArrayList)4 DecodingException (org.n52.svalbard.decode.exception.DecodingException)4 EncodingException (org.n52.svalbard.encode.exception.EncodingException)4 SweBoolean (org.n52.shetland.ogc.swe.simpleType.SweBoolean)3 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)3 SweTimeRange (org.n52.shetland.ogc.swe.simpleType.SweTimeRange)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 CapabilityListType (net.opengis.sensorml.x20.CapabilityListType)2 Capability (net.opengis.sensorml.x20.CapabilityListType.Capability)2 CharacteristicListType (net.opengis.sensorml.x20.CharacteristicListType)2 Characteristic (net.opengis.sensorml.x20.CharacteristicListType.Characteristic)2 Capabilities (net.opengis.sensorml.x20.DescribedObjectType.Capabilities)2 DataRecordType (net.opengis.swe.x20.DataRecordType)2 DescribedObject (org.n52.shetland.ogc.sensorML.v20.DescribedObject)2 SweDataArray (org.n52.shetland.ogc.swe.SweDataArray)2 SweEnvelope (org.n52.shetland.ogc.swe.SweEnvelope)2