本文整理汇总了Java中net.opengis.om.x20.OMObservationDocument类的典型用法代码示例。如果您正苦于以下问题:Java OMObservationDocument类的具体用法?Java OMObservationDocument怎么用?Java OMObservationDocument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OMObservationDocument类属于net.opengis.om.x20包,在下文中一共展示了OMObservationDocument类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transformXmlBeans
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
@Override
protected EposEvent transformXmlBeans(XmlObject input) throws TransformationException {
MapEposEvent result = null;
if (input instanceof OMObservationDocument) {
result = transformFrom((OMObservationDocument) input);
result.put(MapEposEvent.ORIGNIAL_OBJECT_KEY, input);
}
else if (input instanceof OMObservationType) {
OMObservationDocument doc = OMObservationDocument.Factory.newInstance();
doc.setOMObservation((OMObservationType) input);
result = transformFrom(doc);
result.put(MapEposEvent.ORIGNIAL_OBJECT_KEY, doc);
}
if (result == null) {
throw new IllegalStateException("Should never reach here!");
}
result.put(MapEposEvent.ORIGNIAL_OBJECT_KEY, input);
return result;
}
示例2: parse
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
@Override
public List<MapEvent> parse(NotificationMessage message) throws Exception {
List<Element> contents = extractMessageContent(message, supportedQNames);
List<MapEvent> result = new ArrayList<MapEvent>();
XmlObject xo = null;
for (Element elem : contents) {
xo = XmlObject.Factory.parse(elem);
if (xo instanceof OMObservationDocument) {
result.add(parseObservation((OMObservationDocument) xo));
}
else if (xo instanceof FeatureCollectionDocument) {
result.addAll(parseFeatureCollection((FeatureCollectionDocument) xo));
}
}
return result;
}
示例3: supportsXmlBeansInput
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
@Override
protected boolean supportsXmlBeansInput(XmlObject input) {
if (input == null)
return false;
if (input instanceof OMObservationDocument ||
input instanceof OMObservationType) {
return true;
}
return false;
}
示例4: createRestMeasurement
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
private String createRestMeasurement(final String sensorId, final String offeringId, final long timestamp,
final double value, final String featureId, final String observableProperty) {
OMObservationDocument observationDoc = OMObservationDocument.Factory.newInstance();
OMObservationType observation = observationDoc.addNewOMObservation();
observation.addNewPhenomenonTime().addNewAbstractTimeObject().substitute(new QName("http://www.opengis.net/gml/3.2", "TimePeriod", "gml"), TimePeriodType.type);
TimePeriodType timePeriodType = TimePeriodType.Factory.newInstance();
timePeriodType.setId("tp_123");
timePeriodType.addNewBeginPosition().setStringValue(new DateTime(timestamp).toString());
timePeriodType.addNewEndPosition().setStringValue(new DateTime(timestamp).toString());
TimeInstantType timeInstant = observation.addNewResultTime().addNewTimeInstant();
timeInstant.setId("ti_123");
timeInstant.addNewTimePosition().setStringValue(new DateTime(timestamp).toString());
observation.addNewProcedure().setHref(sensorId);
observation.addNewObservedProperty().setHref(observableProperty);
observation.addNewFeatureOfInterest().setHref(featureId);
MeasureType measureType = MeasureType.Factory.newInstance();
measureType.setUom("test-unit");
measureType.setDoubleValue(value);
final ObservationDocument restObsDoc =
ObservationDocument.Factory.newInstance();
final ObservationType restObservation = restObsDoc.addNewObservation();
restObservation.setOMObservation(observation);
final LinkType link = restObservation.addNewLink();
link.setType(CONTENT_TYPE);
link.setRel(EncodingNamespace + "/" + ResourceRelationOfferingGet);
link.setHref(/*ServiceUrl + */UrlPattern + "/"
+ ResourceOfferings + "/" + offeringId);
return restObsDoc.xmlText();
}
示例5: transformFrom
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
private MapEposEvent transformFrom(OMObservationDocument input) {
return transformFrom(input.getOMObservation());
}
示例6: getSupportedQName
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
@Override
protected QName getSupportedQName() {
return OMObservationDocument.type.getDocumentElementName();
}
示例7: readXml
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
private OMObservationDocument readXml() throws IOException, XmlException {
return OMObservationDocument.Factory.parse(getClass().getResourceAsStream("om.xml"));
}
示例8: parseObservation
import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
private MapEvent parseObservation(OMObservationDocument xo) {
OMObservationType obs = xo.getOMObservation();
MapEvent result = parsePhenomenonTime(obs.getPhenomenonTime());
parseProcedure(obs.getProcedure(), result);
parseObservedProperty(obs.getObservedProperty(), result);
parseFeatureOfInterest(obs.getFeatureOfInterest(), result);
parseResult(obs.getResult(), result);
return result;
}