当前位置: 首页>>代码示例>>Java>>正文


Java OMObservationDocument类代码示例

本文整理汇总了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;
}
 
开发者ID:52North,项目名称:epos,代码行数:23,代码来源:OM20Transformer.java

示例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;
}
 
开发者ID:52North,项目名称:SES,代码行数:19,代码来源:OM20Parser.java

示例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;
}
 
开发者ID:52North,项目名称:epos,代码行数:13,代码来源:OM20Transformer.java

示例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();
}
 
开发者ID:52North,项目名称:SOS-Test-Suite,代码行数:36,代码来源:RestBindingTest.java

示例5: transformFrom

import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
private MapEposEvent transformFrom(OMObservationDocument input) {
	return transformFrom(input.getOMObservation());
}
 
开发者ID:52North,项目名称:epos,代码行数:4,代码来源:OM20Transformer.java

示例6: getSupportedQName

import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
@Override
protected QName getSupportedQName() {
	return OMObservationDocument.type.getDocumentElementName();
}
 
开发者ID:52North,项目名称:epos,代码行数:5,代码来源:OM20Transformer.java

示例7: readXml

import net.opengis.om.x20.OMObservationDocument; //导入依赖的package包/类
private OMObservationDocument readXml() throws IOException, XmlException {
    return OMObservationDocument.Factory.parse(getClass().getResourceAsStream("om.xml"));
}
 
开发者ID:52North,项目名称:epos,代码行数:4,代码来源:OM20TransformerTest.java

示例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;
}
 
开发者ID:52North,项目名称:SES,代码行数:16,代码来源:OM20Parser.java


注:本文中的net.opengis.om.x20.OMObservationDocument类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。