當前位置: 首頁>>代碼示例>>Java>>正文


Java TimeInstantDocument類代碼示例

本文整理匯總了Java中net.opengis.gml.x32.TimeInstantDocument的典型用法代碼示例。如果您正苦於以下問題:Java TimeInstantDocument類的具體用法?Java TimeInstantDocument怎麽用?Java TimeInstantDocument使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TimeInstantDocument類屬於net.opengis.gml.x32包,在下文中一共展示了TimeInstantDocument類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addEqualsTimePositionFilter

import net.opengis.gml.x32.TimeInstantDocument; //導入依賴的package包/類
private void addEqualsTimePositionFilter(GetObservationType xb_getObs, String timeIso8601Format) {
    TimePositionDocument timePositionDoc = TimePositionDocument.Factory.newInstance();
    TimePositionType timePositionType = timePositionDoc.addNewTimePosition();
    timePositionType.setStringValue(timeIso8601Format);
    timePositionType.set(timePositionType);

    TimeInstantDocument timeInstanceDoc = TimeInstantDocument.Factory.newInstance();
    TimeInstantType xb_timeInstant = timeInstanceDoc.addNewTimeInstant();
    xb_timeInstant.setTimePosition(timePositionType);
    xb_timeInstant.setId("_1");

    TEqualsDocument equalsDoc = TEqualsDocument.Factory.newInstance();
    BinaryTemporalOpType xb_binTempOp = equalsDoc.addNewTEquals();
    
    xb_binTempOp.set(timeInstanceDoc);
    xb_binTempOp.setValueReference("phenomenonTime");

    TemporalFilter spatialFilter = xb_getObs.addNewTemporalFilter();
    spatialFilter.set(equalsDoc);
}
 
開發者ID:52North,項目名稱:SensorWebClient,代碼行數:21,代碼來源:SOSRequestBuilder_200_OXFExtension.java

示例2: getInsertObservationMinimalDocument

import net.opengis.gml.x32.TimeInstantDocument; //導入依賴的package包/類
public static InsertObservationDocument getInsertObservationMinimalDocument() {
    final InsertObservationDocument insertObservationDocument =
            InsertObservationDocument.Factory.newInstance();
    final InsertObservationType insertObservationType =
            insertObservationDocument.addNewInsertObservation();
    insertObservationType.addOffering("offering");
    final OMObservationType observation = insertObservationType
            .addNewObservation().addNewOMObservation();
    observation.setId("id");
    final TimeInstantDocument timeInstantDocument =
            TimeInstantDocument.Factory.newInstance();
    final TimeInstantType timeInstantType = timeInstantDocument
            .addNewTimeInstant();
    timeInstantType.setId("phenomenonTime");
    timeInstantType.addNewTimePosition()
            .setObjectValue("2000-01-01T00:00:00Z");
    observation.addNewPhenomenonTime().set(timeInstantDocument);
    observation.addNewResultTime().setHref("#phenomenonTime");
    observation.addNewProcedure();
    observation.addNewObservedProperty();
    observation.addNewFeatureOfInterest().setHref("featureOfInterest");
    XmlObject result = observation.addNewResult();
    result = result
            .substitute(new QName(OmConstants.NS_OM_2, OmConstants.EN_RESULT), XmlString.type);
    result.set(XmlString.Factory.newValue("value"));
    return insertObservationDocument;
}
 
開發者ID:52North,項目名稱:SOS-Test-Suite,代碼行數:28,代碼來源:RequestBuilder.java

示例3: parseTime

import net.opengis.gml.x32.TimeInstantDocument; //導入依賴的package包/類
/**
 * Parses the time from a GML32 time object.
 * 
 * @param time the xmlobject which holds the time
 * @return {@link DateTime} array, null if nothing could be found
 */
public static DateTime[] parseTime(XmlObject time) {
	DateTime begin = null;
	DateTime end = null;

	/*
	 * wrapped in a document
	 */
	if (time instanceof TimePeriodDocument) {
		return parseTime(((TimePeriodDocument) time).getTimePeriod());
	}
	else if (time instanceof TimeInstantDocument) {
		return parseTime(((TimeInstantDocument) time).getTimeInstant());
	}

	/*
	 * just the types
	 */
	else if (time instanceof TimePeriodType) {
		/*
		 * TimePeriod
		 */
		TimePeriodType tpt = (TimePeriodType) time;

		if (tpt.isSetBeginPosition()) {
			begin = new DateTime(tpt.getBeginPosition().getStringValue());
		}
		else if (tpt.isSetBegin()) {
			begin = new DateTime(tpt.getBegin().getTimeInstant().getTimePosition().getStringValue());
		}

		if (tpt.isSetEndPosition()) {
			end = new DateTime(tpt.getEndPosition().getStringValue());
		}
		else if (tpt.isSetEnd()) {
			begin = new DateTime(tpt.getEnd().getTimeInstant().getTimePosition().getStringValue());
		}
	}
	else if (time instanceof TimeInstantType) {
		/*
		 * TimeInstanct
		 */
		TimeInstantType tit = (TimeInstantType) time;

		begin = new DateTime(tit.getTimePosition().getStringValue());

	}

	/*
	 * check what should be returned.
	 * 1-elem array if just begin is found
	 */
	if (begin != null) {
		if (end == null) {
			return new DateTime[] {begin};
		}
		return new DateTime[] {begin, end};
	}

	return null;
}
 
開發者ID:52North,項目名稱:SES,代碼行數:67,代碼來源:GML32Parser.java


注:本文中的net.opengis.gml.x32.TimeInstantDocument類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。