本文整理汇总了Java中net.opengis.sensorML.x101.AbstractProcessType类的典型用法代码示例。如果您正苦于以下问题:Java AbstractProcessType类的具体用法?Java AbstractProcessType怎么用?Java AbstractProcessType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractProcessType类属于net.opengis.sensorML.x101包,在下文中一共展示了AbstractProcessType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addObservationTimeRange
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
private void addObservationTimeRange(String procedure, AbstractProcessType xbAbstractProcess) {
removeExistingCapabilities(xbAbstractProcess, IoosSweConstants.OBSERVATION_TIME_RANGE);
Capabilities xbObsTimeRangeCap = xbAbstractProcess.addNewCapabilities();
xbObsTimeRangeCap.setName(IoosSweConstants.OBSERVATION_TIME_RANGE);
DataRecordType xbDataRecord = (DataRecordType) xbObsTimeRangeCap.addNewAbstractDataRecord()
.substitute(SweConstants.QN_DATA_RECORD_SWE_101, DataRecordType.type);
DataComponentPropertyType xbField = xbDataRecord.addNewField();
xbField.setName(IoosSweConstants.OBSERVATION_TIME_RANGE);
TimeRange xbTimeRange = xbField.addNewTimeRange();
xbTimeRange.setDefinition(IoosSweConstants.OBSERVATION_TIME_RANGE_DEF);
if (Configurator.getInstance() != null) {
DateTime minProcPhenTime = Configurator.getInstance().getCache().getMinPhenomenonTimeForProcedure(procedure);
DateTime maxProcPhenTime = Configurator.getInstance().getCache().getMaxPhenomenonTimeForProcedure(procedure);
if (minProcPhenTime != null && maxProcPhenTime != null) {
xbTimeRange.setValue(Lists.newArrayList(DateTimeHelper.formatDateTime2IsoString(minProcPhenTime),
DateTimeHelper.formatDateTime2IsoString(maxProcPhenTime)));
}
}
}
示例2: addSpatialBounds
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
private void addSpatialBounds(String procedure, AbstractProcessType xbAbstractProcess) throws OwsExceptionReport {
//remove existing bounded by
while (xbAbstractProcess.isSetBoundedBy()) {
xbAbstractProcess.unsetBoundedBy();
}
Configurator configurator = Configurator.getInstance();
if (configurator == null || configurator.getCache() == null) {
//if configurator is null this might be a test, just return
return;
}
ContentCache cache = configurator.getCache();
//assume that the procedure has an equivalent offering (sensors won't have this)
if (cache.hasEnvelopeForOffering(procedure)) {
SosEnvelope envelopeForOffering = cache.getEnvelopeForOffering(procedure);
EnvelopeType xbEnvelope = xbAbstractProcess.addNewBoundedBy().addNewEnvelope();
xbEnvelope.set(CodingHelper.encodeObjectToXml(GmlConstants.NS_GML, envelopeForOffering));
}
}
示例3: main
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
/*
* CosmFeedHelperImpl helper = new CosmFeedHelperImpl(); CosmFeed feed =
* helper.parseFeed(126768); CosmSensorML ml = helper.decodeFeed(feed);
* // use ml
*/
/*Capability c = new Capability("urn:ogc:def:property:OGC:1.0:isActive", "boolean", "true");
List<Capability> caps = new ArrayList<Capability>();
caps.add(c);
CosmSensorML ml = new CosmSensorML("urn:ogc:object:feature:testsensor",
"A Test Sensor", "TEST", "2012", "2013",
caps, new ArrayList<String>());
ml.setLongitude("3.5");
ml.setLatitude("1.4");
ml.setAltitude("2.1");
SensorMLDocumentEncoder encoder = new SensorMLDocumentEncoderImpl();
System.out.println(encoder.encode(ml));*/
SensorMLDocument doc = SensorMLDocument.Factory.parse(new File("E:/cosm/downloaded/Cosm2sml/src/test/resources/testsensor.xml"));
SensorML ml = doc.getSensorML();
AbstractProcessType p = (ml.getMemberArray()[0].getProcess());
System.out.println(p.getIdentificationArray()[0].getIdentifierList().getIdentifierArray()[0].getTerm().getValue());
}
示例4: addIoosExtras
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
private void addIoosExtras(final String procedure, final SensorMLDocument xbSmlDoc) throws OwsExceptionReport {
addServiceMetadata(xbSmlDoc);
AbstractProcessType xbAbstractProcess = getAbstractProcessMemberFromWrapper(xbSmlDoc);
if (xbAbstractProcess != null) {
addObservationTimeRange(procedure, xbAbstractProcess);
addSpatialBounds(procedure, xbAbstractProcess);
}
}
示例5: getAbstractProcessMemberFromWrapper
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
private AbstractProcessType getAbstractProcessMemberFromWrapper(SensorMLDocument xbSmlDoc) {
if (xbSmlDoc.getSensorML() != null && xbSmlDoc.getSensorML().getMemberArray() != null
&& xbSmlDoc.getSensorML().getMemberArray().length > 0
&& xbSmlDoc.getSensorML().getMemberArray(0).getProcess() != null) {
return (AbstractProcessType) xbSmlDoc.getSensorML().getMemberArray(0).getProcess();
}
return null;
}
示例6: removeExistingCapabilities
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
/**
* Remove an sml:capabilities from a SensorMLDocument if it exists
* @param xbSmlDoc The SensorMLDocument to operate on
* @param capabilitiesName Name of the capabilities to remove
*/
private void removeExistingCapabilities(XmlObject xbXmlObject, String capabilitiesName) {
Capabilities[] capabilitiesArray = null;
if (xbXmlObject instanceof SensorMLDocument.SensorML) {
capabilitiesArray = ((SensorMLDocument.SensorML) xbXmlObject).getCapabilitiesArray();
} else if (xbXmlObject instanceof AbstractProcessType) {
capabilitiesArray = ((AbstractProcessType) xbXmlObject).getCapabilitiesArray();
} else {
throw new IllegalArgumentException(String.format("Encountered unsupported XmlObject type '%s'",
xbXmlObject.getClass().getSimpleName()));
}
//remove existing service metadata if found
if (capabilitiesArray != null) {
boolean fullIteration = false;
while (!fullIteration) {
for (int i = 0; i < capabilitiesArray.length; i++) {
Capabilities xbCapabilities = capabilitiesArray[i];
if (xbCapabilities.isSetName() && xbCapabilities.getName().equals(capabilitiesName)) {
//remove this capabilities and start the loop over, since there may be others
//and the array index will have shifted after the delete
if (xbXmlObject instanceof SensorMLDocument.SensorML) {
((SensorMLDocument.SensorML) xbXmlObject).removeCapabilities(i);
} else if (xbXmlObject instanceof AbstractProcessType) {
((AbstractProcessType) xbXmlObject).removeCapabilities(i);
}
//don't need to check for other types since we already did above
}
}
fullIteration = true;
}
}
}
示例7: buildUpSensorMetadataStationName
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
public String buildUpSensorMetadataStationName() {
String stationName = "";
final AbstractProcessType abstractProcessType = smlDoc.getSensorML().getMemberArray(0).getProcess();
if (abstractProcessType instanceof AbstractComponentType) {
stationName = getStationNameByAbstractComponentType((AbstractComponentType) abstractProcessType);
}
return stationName;
}
示例8: buildUpSensorMetadataUom
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
public String buildUpSensorMetadataUom(final String phenomenonID) {
String uom = "";
final AbstractProcessType abstractProcessType = smlDoc.getSensorML().getMemberArray(0).getProcess();
if (abstractProcessType instanceof AbstractComponentType) {
uom = getUomByAbstractComponentType(phenomenonID, (AbstractComponentType) abstractProcessType);
}
else if (abstractProcessType instanceof ProcessModelTypeImpl) {
uom = getUomByProcessModelTypeImpl(phenomenonID, (ProcessModelTypeImpl) abstractProcessType);
}
return uom;
}
示例9: buildUpSensorMetadataPosition
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
public Point buildUpSensorMetadataPosition() throws FactoryException, TransformException {
final SensorML sensorML = smlDoc.getSensorML();
final Member[] members = sensorML.getMemberArray();
if (members != null && members.length > 0) {
AbstractProcessType abstractProcessType = members[0].getProcess();
if (abstractProcessType instanceof AbstractComponentType) {
final AbstractComponentType sysDoc = (AbstractComponentType) abstractProcessType;
final PositionType position = sysDoc.getPosition().getPosition();
return createPoint(position);
}
}
return null;
}
示例10: getPhenomenons
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
public List<String> getPhenomenons() {
final List<String> phenomenons = new ArrayList<String>();
final AbstractProcessType absProcessType = smlDoc.getSensorML().getMemberArray()[0].getProcess();
OutputList outputs = null;
if (absProcessType instanceof AbstractComponentType) {
outputs = ((AbstractComponentType) absProcessType).getOutputs().getOutputList();
}
else if (absProcessType instanceof ProcessModelType) {
outputs = ((ProcessModelType) absProcessType).getOutputs().getOutputList();
}
for (final IoComponentPropertyType output : outputs.getOutputArray()) {
if (output.isSetObservableProperty()) {
phenomenons.add(output.getObservableProperty().getDefinition());
}
else if (output.getAbstractDataArray1() != null) {
phenomenons.add(output.getAbstractDataArray1().getDefinition());
}
else if (output.isSetQuantity()) {
phenomenons.add(output.getQuantity().getDefinition());
}
else if (isCategoryCodeSpaceHrefSet(output)) {
phenomenons.add(output.getCategory().getDefinition());
}
else {
phenomenons.add(output.getName());
}
}
return phenomenons;
}
示例11: testGetObservationIoosSweEncoding
import net.opengis.sensorML.x101.AbstractProcessType; //导入依赖的package包/类
@Test
public void testGetObservationIoosSweEncoding() throws OwsExceptionReport, XmlException {
XmlObject getObsResponse = sendGetObservation1RequestViaPox(NETWORK_OFFERING, IoosSosConstants.OM_PROFILE_M10,
ImmutableList.of(STATION_ASSET.getAssetId()), ImmutableList.of(OBS_PROP),null).asXmlObject();
assertNotNull(getObsResponse);
assertThat(getObsResponse, is(instanceOf(ObservationCollectionDocument.class)));
ObservationCollectionDocument obsCollectionDoc = (ObservationCollectionDocument) getObsResponse;
ObservationCollectionType obsCollection = obsCollectionDoc.getObservationCollection();
//TODO verify
BoundingShapeType boundedBy = obsCollection.getBoundedBy();
//TODO verify
LocationPropertyType location = obsCollection.getLocation();
assertThat(obsCollection.getMemberArray().length, is(1));
ObservationPropertyType observationProperty = obsCollection.getMemberArray()[0];
ObservationType observation = observationProperty.getObservation();
assertThat(observation, notNullValue());
//TODO verify
FeaturePropertyType featureOfInterest = observation.getFeatureOfInterest();
AbstractFeatureType feature = featureOfInterest.getFeature();
//TODO verify
ProcessPropertyType procedure = observation.getProcedure();
AbstractProcessType process = procedure.getProcess();
XmlObject result = observation.getResult();
assertThat(result, notNullValue());
//TODO verify
DataRecordDocument swe2DataRecordDocument = castXmlAnyToClass(result, DataRecordDocument.class);
DataRecordType swe2DataRecord = swe2DataRecordDocument.getDataRecord();
//observationRecord definition
assertThat(swe2DataRecord.getDefinition(), is(IoosSweConstants.OBSERVATION_RECORD_DEF));
Field[] fields = swe2DataRecord.getFieldArray();
Field stationsField = fields[0];
assertThat(stationsField.getName(), is(IoosSweConstants.STATIONS));
AbstractDataComponentType stationsAbstractDataComponent = stationsField.getAbstractDataComponent();
assertThat(stationsAbstractDataComponent, is(instanceOf(DataRecordType.class)));
DataRecordType stationsDataRecord = (DataRecordType) stationsAbstractDataComponent;
assertThat(stationsDataRecord.getDefinition(), is(IoosSweConstants.STATIONS_DEF));
}