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;
}
Aggregations