31 QDomElement temporalElement = doc.createElement( QStringLiteral(
"temporal" ) );
32 temporalElement.setAttribute( QStringLiteral(
"temporal-active" ),
isActive() ?
true :
false );
33 temporalElement.setAttribute( QStringLiteral(
"reference-time" ), mReferenceTime.toTimeSpec( Qt::UTC ).toString( Qt::ISODate ) );
34 temporalElement.setAttribute( QStringLiteral(
"start-time-extent" ), mTimeExtent.begin().toTimeSpec( Qt::UTC ).toString( Qt::ISODate ) );
35 temporalElement.setAttribute( QStringLiteral(
"end-time-extent" ), mTimeExtent.end().toTimeSpec( Qt::UTC ).toString( Qt::ISODate ) );
36 temporalElement.setAttribute( QStringLiteral(
"matching-method" ), mMatchingMethod );
38 element.appendChild( temporalElement );
47 QDomElement temporalElement = element.firstChildElement( QStringLiteral(
"temporal" ) );
48 bool active = temporalElement.attribute( QStringLiteral(
"temporal-active" ) ).toInt();
51 mReferenceTime = QDateTime::fromString( temporalElement.attribute( QStringLiteral(
"reference-time" ) ), Qt::ISODate );
53 if ( temporalElement.hasAttribute( QStringLiteral(
"start-time-extent" ) )
54 && temporalElement.hasAttribute( QStringLiteral(
"end-time-extent" ) ) )
56 QDateTime start = QDateTime::fromString( temporalElement.attribute( QStringLiteral(
"start-time-extent" ) ), Qt::ISODate );
57 QDateTime end = QDateTime::fromString( temporalElement.attribute( QStringLiteral(
"end-time-extent" ) ), Qt::ISODate );
58 mTimeExtent = QgsDateTimeRange( start, end );
62 temporalElement.attribute( QStringLiteral(
"matching-method" ) ).toInt() );
75 if ( mReferenceTime.isValid() )
76 mTimeExtent = temporalCapabilities->
timeExtent();
91 return mReferenceTime;
108 return mMatchingMethod;