本文整理匯總了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);
}
示例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;
}
示例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;
}