use of org.n52.shetland.ogc.sensorML.v20.PhysicalSystem in project arctic-sea by 52North.
the class SensorMLDecoderV20 method parsePhysicalSystem.
private DescribedObject parsePhysicalSystem(PhysicalSystemType describedObject) throws DecodingException {
PhysicalSystem ps = new PhysicalSystem();
parseAbstractPhysicalProcess(describedObject, ps);
parseAbstractProcess(describedObject, ps);
parseDescribedObject(describedObject, ps);
if (describedObject.isSetComponents()) {
ps.addComponents(parseComponents(describedObject.getComponents()));
final List<Integer> compsToRemove = checkComponentsForRemoval(describedObject.getComponents().getComponentList());
compsToRemove.forEach(describedObject.getComponents().getComponentList()::removeComponent);
if (removeEmptyComponents(describedObject.getComponents())) {
describedObject.unsetComponents();
}
}
return ps;
}
use of org.n52.shetland.ogc.sensorML.v20.PhysicalSystem in project arctic-sea by 52North.
the class SensorMLEncoderv20 method addPhysicalSystemValues.
private void addPhysicalSystemValues(PhysicalSystemType pst, PhysicalSystem abstractPhysicalProcess) throws EncodingException {
addAbstractProcessValues(pst, abstractPhysicalProcess);
addDescribedObjectValues(pst, abstractPhysicalProcess);
addAbstractPhysicalProcessValues(pst, abstractPhysicalProcess);
// set components
if (abstractPhysicalProcess.isSetComponents()) {
List<SmlComponent> smlComponents = checkForComponents(abstractPhysicalProcess);
if (!smlComponents.isEmpty()) {
ComponentListPropertyType clpt = createComponents(smlComponents);
if (clpt != null && clpt.getComponentList() != null && clpt.getComponentList().sizeOfComponentArray() > 0) {
pst.setComponents(clpt);
}
}
}
// set connections
if (abstractPhysicalProcess.isSetConnections() && !pst.isSetConnections()) {
pst.setConnections(createConnections(abstractPhysicalProcess.getConnections()));
}
}
use of org.n52.shetland.ogc.sensorML.v20.PhysicalSystem in project arctic-sea by 52North.
the class InsertObservationRequestEncoderTest method createInsertObservationRequest.
private InsertObservationRequest createInsertObservationRequest() throws InvalidSridException, ParseException {
SamplingFeature samplingFeature = new SamplingFeature(new CodeWithAuthority("test-feature-uri"));
samplingFeature.setName(new CodeType("test-feature-name"));
samplingFeature.setSampledFeatures(Arrays.asList(new SamplingFeature(new CodeWithAuthority("test-parent-feature-uri"))));
samplingFeature.setGeometry(JTSHelper.createGeometryFromWKT("POINT(52.0 42.0)", 4326));
PhysicalSystem procedure = new PhysicalSystem();
procedure.setIdentifier("test-procedure");
OmObservationConstellation observationConstellation = new OmObservationConstellation();
observationConstellation.setGmlId("o1");
observationConstellation.setObservationType(OmConstants.OBS_TYPE_MEASUREMENT);
observationConstellation.setObservableProperty(new OmObservableProperty("test-property"));
observationConstellation.setFeatureOfInterest(samplingFeature);
observationConstellation.setProcedure(procedure);
TimeInstant time = new TimeInstant(new Date(0));
QuantityValue quantity = new QuantityValue(23.0, "test-uom");
ObservationValue<?> value = new SingleObservationValue<>(time, quantity);
OmObservation omObservation = new OmObservation();
omObservation.setObservationConstellation(observationConstellation);
omObservation.setResultTime(time);
omObservation.setValue(value);
InsertObservationRequest request = new InsertObservationRequest("SOS", "2.0.0");
request.setOfferings(Arrays.asList(OFFERING_ID));
request.addObservation(omObservation);
return request;
}
use of org.n52.shetland.ogc.sensorML.v20.PhysicalSystem in project arctic-sea by 52North.
the class InsertSensorRequestEncoderTest method createProcedureDescription.
private SosProcedureDescription<PhysicalSystem> createProcedureDescription() {
PhysicalSystem description = new PhysicalSystem();
description.setIdentifier("test-identifier");
return new SosProcedureDescription<>(description);
}
Aggregations