Search in sources :

Example 1 with CategoricalTimeLocationValueTripleType

use of eu.europa.ec.inspire.schemas.omso.x30.CategoricalTimeLocationValueTripleType in project arctic-sea by 52North.

the class AbstractTimeLocationValueTripleTypeEncoder method createCategoricalTimeLocationValueTripleType.

/**
 * Create a {@link CategoricalTimeLocationValueTripleType} from
 * {@link TimeLocationValueTriple}
 *
 * @param timeLocationValueTriple
 *            The {@link TimeLocationValueTriple} to encode
 * @return The encoded {@link TimeLocationValueTriple}
 * @throws EncodingException
 *             If an error occurs
 */
private TimeValuePairType createCategoricalTimeLocationValueTripleType(TimeLocationValueTriple timeLocationValueTriple) throws EncodingException {
    CategoricalTimeLocationValueTripleType ctlvtt = CategoricalTimeLocationValueTripleType.Factory.newInstance();
    ctlvtt.addNewTime().setStringValue(getTimeString(timeLocationValueTriple.getTime()));
    ctlvtt.addNewLocation().addNewPoint().set(encodeGML(timeLocationValueTriple.getLocation()));
    if (timeLocationValueTriple.getValue() instanceof CategoryValue) {
        CategoryValue categoryValue = (CategoryValue) timeLocationValueTriple.getValue();
        if (categoryValue.isSetValue()) {
            ctlvtt.addNewValue().addNewCategory().set(encodeSweCommon(convertToSweCategory(categoryValue)));
        } else {
            ctlvtt.addNewValue().setNil();
            ctlvtt.addNewMetadata().addNewTVPMetadata().addNewNilReason().setNilReason(MISSING);
        }
    }
    return ctlvtt;
}
Also used : CategoricalTimeLocationValueTripleType(eu.europa.ec.inspire.schemas.omso.x30.CategoricalTimeLocationValueTripleType) CategoryValue(org.n52.shetland.ogc.om.values.CategoryValue)

Aggregations

CategoricalTimeLocationValueTripleType (eu.europa.ec.inspire.schemas.omso.x30.CategoricalTimeLocationValueTripleType)1 CategoryValue (org.n52.shetland.ogc.om.values.CategoryValue)1