Search in sources :

Example 1 with StringOrRefType

use of net.opengis.gml.StringOrRefType in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createSimpleDataRecord.

private SimpleDataRecordType createSimpleDataRecord(SweSimpleDataRecord simpleDataRecord) throws EncodingException {
    SimpleDataRecordType xbSimpleDataRecord = SimpleDataRecordType.Factory.newInstance(getXmlOptions());
    if (simpleDataRecord.isSetDefinition()) {
        xbSimpleDataRecord.setDefinition(simpleDataRecord.getDefinition());
    }
    if (simpleDataRecord.isSetDescription()) {
        StringOrRefType xbSoR = StringOrRefType.Factory.newInstance();
        xbSoR.setStringValue(simpleDataRecord.getDefinition());
        xbSimpleDataRecord.setDescription(xbSoR);
    }
    if (simpleDataRecord.isSetFields()) {
        AnyScalarPropertyType[] xbFields = new AnyScalarPropertyType[simpleDataRecord.getFields().size()];
        int xbFieldIndex = 0;
        for (SweField sweField : simpleDataRecord.getFields()) {
            AnyScalarPropertyType xbField = createFieldForSimpleDataRecord(sweField);
            xbFields[xbFieldIndex] = xbField;
            xbFieldIndex++;
        }
        xbSimpleDataRecord.setFieldArray(xbFields);
    }
    return xbSimpleDataRecord;
}
Also used : StringOrRefType(net.opengis.gml.StringOrRefType) AnyScalarPropertyType(net.opengis.swe.x101.AnyScalarPropertyType) SweField(org.n52.shetland.ogc.swe.SweField) SimpleDataRecordType(net.opengis.swe.x101.SimpleDataRecordType)

Aggregations

StringOrRefType (net.opengis.gml.StringOrRefType)1 AnyScalarPropertyType (net.opengis.swe.x101.AnyScalarPropertyType)1 SimpleDataRecordType (net.opengis.swe.x101.SimpleDataRecordType)1 SweField (org.n52.shetland.ogc.swe.SweField)1