Search in sources :

Example 1 with PhysicalSystem

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;
}
Also used : PhysicalSystem(org.n52.shetland.ogc.sensorML.v20.PhysicalSystem)

Example 2 with PhysicalSystem

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()));
    }
}
Also used : ComponentListPropertyType(net.opengis.sensorml.x20.ComponentListPropertyType) SmlComponent(org.n52.shetland.ogc.sensorML.elements.SmlComponent)

Example 3 with PhysicalSystem

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;
}
Also used : PhysicalSystem(org.n52.shetland.ogc.sensorML.v20.PhysicalSystem) OmObservation(org.n52.shetland.ogc.om.OmObservation) SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature) OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation) Date(java.util.Date) SingleObservationValue(org.n52.shetland.ogc.om.SingleObservationValue) QuantityValue(org.n52.shetland.ogc.om.values.QuantityValue) InsertObservationRequest(org.n52.shetland.ogc.sos.request.InsertObservationRequest) CodeType(org.n52.shetland.ogc.gml.CodeType) CodeWithAuthority(org.n52.shetland.ogc.gml.CodeWithAuthority) OmObservableProperty(org.n52.shetland.ogc.om.OmObservableProperty) TimeInstant(org.n52.shetland.ogc.gml.time.TimeInstant)

Example 4 with PhysicalSystem

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);
}
Also used : PhysicalSystem(org.n52.shetland.ogc.sensorML.v20.PhysicalSystem) SosProcedureDescription(org.n52.shetland.ogc.sos.SosProcedureDescription)

Aggregations

PhysicalSystem (org.n52.shetland.ogc.sensorML.v20.PhysicalSystem)3 Date (java.util.Date)1 ComponentListPropertyType (net.opengis.sensorml.x20.ComponentListPropertyType)1 CodeType (org.n52.shetland.ogc.gml.CodeType)1 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)1 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)1 OmObservableProperty (org.n52.shetland.ogc.om.OmObservableProperty)1 OmObservation (org.n52.shetland.ogc.om.OmObservation)1 OmObservationConstellation (org.n52.shetland.ogc.om.OmObservationConstellation)1 SingleObservationValue (org.n52.shetland.ogc.om.SingleObservationValue)1 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)1 QuantityValue (org.n52.shetland.ogc.om.values.QuantityValue)1 SmlComponent (org.n52.shetland.ogc.sensorML.elements.SmlComponent)1 SosProcedureDescription (org.n52.shetland.ogc.sos.SosProcedureDescription)1 InsertObservationRequest (org.n52.shetland.ogc.sos.request.InsertObservationRequest)1