Search in sources :

Example 1 with TimeGeometricPrimitivePropertyType

use of net.opengis.swe.x101.TimeGeometricPrimitivePropertyType in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createTimeGeometricPrimitivePropertyType.

private XmlObject createTimeGeometricPrimitivePropertyType(TimePeriod timePeriod) throws EncodingException {
    TimeGeometricPrimitivePropertyType xbTimeGeometricPrimitiveProperty = TimeGeometricPrimitivePropertyType.Factory.newInstance(getXmlOptions());
    if (timePeriod.isSetStart() && timePeriod.isSetEnd()) {
        xbTimeGeometricPrimitiveProperty.addNewTimeGeometricPrimitive().set(encodeObjectToXml(GmlConstants.NS_GML, timePeriod));
    }
    // TODO check GML 311 rename nodename of geometric primitive to
    // gml:timePeriod
    XmlCursor timeCursor = xbTimeGeometricPrimitiveProperty.newCursor();
    boolean hasTimePrimitive = timeCursor.toChild(new QName(GmlConstants.NS_GML, GmlConstants.EN_ABSTRACT_TIME_GEOM_PRIM));
    if (hasTimePrimitive) {
        timeCursor.setName(new QName(GmlConstants.NS_GML, GmlConstants.EN_TIME_PERIOD));
    }
    timeCursor.dispose();
    return xbTimeGeometricPrimitiveProperty;
}
Also used : QName(javax.xml.namespace.QName) TimeGeometricPrimitivePropertyType(net.opengis.swe.x101.TimeGeometricPrimitivePropertyType) XmlCursor(org.apache.xmlbeans.XmlCursor)

Aggregations

QName (javax.xml.namespace.QName)1 TimeGeometricPrimitivePropertyType (net.opengis.swe.x101.TimeGeometricPrimitivePropertyType)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1