GEOSS Banner

4.3.1 Publishing Sensors and Sensor Data Using Transactional SOS Operations

Table of contents
No headers

<<Prev T.O.C Next>>

The transactional operations of the OGC Sensor Observation Service (SOS) allow the standardised integration of sensors and data measured by sensors through standardised operations. In the SOS 1.0 specification these are:

  • RegisterSensor: Registering a new sensor with a SOS. This request sends the metadata describing the sensor to the SOS. The service returns a unique identifier of the sensor within the SOS.
  • InsertObservation: After a sensor has been registered in a SOS instance, it is possible to insert data measured by this sensor. An InsertObservation request contains the data as well as the sensor identifier. The response is an identifier of the inserted observation within the SOS.

Please note: In the following examples we have added a specific property to the RegisterSensor request which is not required by all SOS implementations but which helps to specify to which offerings the observations of a sensor shall be associated.

The following figure illustrates the workflow:



Step 1: Registering the sensor

The following example shows a typical RegisterSensor request. Please refer to the XML comments (the text within <!-- -->) for explanations of the different elements:

<?xml version="1.0" encoding="UTF-8"?> <RegisterSensor service="SOS" version="1.0.0" xmlns="" xmlns:swe="" xmlns:ows="" xmlns:xlink="" xmlns:gml="" xmlns:ogc="" xmlns:om="" xmlns:sml="" xmlns:xsi="" xsi:schemaLocation=""> <!-- SensorDescription parameter; in this example we use a sml:System Other description formats (e.g. TML or StarFL, a new approach currently in development) could be used as well if supported by the specific SOS implementation --> <SensorDescription> <sml:SensorML version="1.0.1"> <sml:member> <sml:System xmlns:xsi=""> <!--sml:identification element must contain the ID of the sensor (here: ExampleSensor1)--> <sml:identification> <sml:IdentifierList> <sml:identifier> <sml:Term definition="urn:ogc:def:identifier:OGC:uniqueID"> <sml:value>ExampleSensor1</sml:value> </sml:Term> </sml:identifier> </sml:IdentifierList> </sml:identification> <!-- location of the sensor --> <sml:position name="sensorPosition"> <swe:Position referenceFrame="urn:ogc:def:crs:EPSG::4326"> <swe:location> <swe:Vector gml:id="STATION_LOCATION"> <swe:coordinate name="easting"> <swe:Quantity> <swe:uom code="degree"/> <swe:value>7.52</swe:value> </swe:Quantity> </swe:coordinate> <swe:coordinate name="northing"> <swe:Quantity> <swe:uom code="degree"/> <swe:value>52.90</swe:value> </swe:Quantity> </swe:coordinate> <swe:coordinate name="altitude"> <swe:Quantity> <swe:uom code="m"/> <swe:value>52.0</swe:value> </swe:Quantity> </swe:coordinate> </swe:Vector> </swe:location> </swe:Position> </sml:position> <!-- list containing the inputs measured by the sensor (in this example temperature) --> <sml:inputs> <sml:InputList> <sml:input name="temperature"> <swe:ObservableProperty definition= "urn:x-ogc:def:property:OGC::Temperature"/> </sml:input> </sml:InputList> </sml:inputs> <!-- list containing the outputs of the sensor --> <sml:outputs> <sml:OutputList> <sml:output name="temperature"> <swe:Quantity definition= "urn:x-ogc:def:property:OGC::Temperature"> <gml:metaDataProperty> <!-- in this example we also specify the offering of the SOS to which the output shall be associated; this is specific to the 52°North implementation as it allows to directly specify to which offering the sensor shall be associated --> <offering> <id>urn:x-ogc:def:property:OGC::Temperature</id> <name>temperature measurements</name> </offering> </gml:metaDataProperty> <swe:uom code="°C"/> </swe:Quantity> </sml:output> </sml:OutputList> </sml:outputs> </sml:System> </sml:member> </sml:SensorML> </SensorDescription> <!-- ObservationTemplate parameter; this has to be an empty measurement which shows the structure of the measurements that will be inserted --> <ObservationTemplate> <om:Measurement> <om:samplingTime/> <om:procedure/> <om:observedProperty/> <om:featureOfInterest/> <om:result uom=""/> </om:Measurement> </ObservationTemplate> </RegisterSensor>

The response to this request looks as follows. You can see the AssignedSensorId (in this case ExampleSensor1) as the only response parameter. You have to remember this identifier for inserting observations in the next step.

<?xml version="1.0" encoding="UTF-8"?>

Step 2: Inserting observation data

The next request shows how it is possible to insert data for the previously registered sensor. Once you have registered a sensor as described in the step before you can send an unlimited number of InsertObservation requests. Please note: In this example we show the inserting of an om:Measurement. However, by providing different result templates, it is also possible to insert other kinds of observations (arrays, boolean values, categorical observations).

Below you find an example for such a request:

<?xml version="1.0" encoding="UTF-8"?> <InsertObservation xmlns="" xmlns:ows="" xmlns:ogc="" xmlns:om="" xmlns:sos="" xmlns:sa="" xmlns:gml="" xmlns:swe="" xmlns:xlink="" xmlns:xsi="" xsi:schemaLocation="" service="SOS" version="1.0.0"> <!-- the identifier of the sensor within the SOS; you have received this identifier in the RegisterSensor response --> <AssignedSensorId>ExampleSensor1</AssignedSensorId> <om:Measurement> <!-- the point in time when the measurement was performed --> <om:samplingTime> <gml:TimeInstant> <gml:timePosition>2010-02-01T12:00:00+01:00</gml:timePosition> </gml:TimeInstant> </om:samplingTime> <!-- the point in time when the measurement was performed --> <om:procedure xlink:href="ExampleSensor1"/> <!-- the phenomenon that was observed by the sensor --> <om:observedProperty xlink:href="urn:x-ogc:def:property:OGC::Temperature"/> <!-- the geometric feature to whcih the measurement shall be associated (e.g. the location of the sensor station) --> <om:featureOfInterest> <sa:SamplingPoint gml:id="ExampleSensor1Station"> <gml:name>ExampleSensor1 Station</gml:name> <sa:sampledFeature xlink:href=""/> <sa:position> <gml:Point> <!-- the coordinates of the sensor station including --> <gml:pos srsName="urn:ogc:def:crs:EPSG::4326">51.9412 7.6103</gml:pos> </gml:Point> </sa:position> </sa:SamplingPoint> </om:featureOfInterest> <!-- the measured value and the measurement unit --> <om:result uom="°C">10.0</om:result> </om:Measurement> </InsertObservation>

The response is again very compact. As shown in the following example it only contains an identifier of the observation within the SOS. This allows querying specific observations using an operation not explained in this tutorial.

<?xml version="1.0" encoding="UTF-8"?> <sos:InsertObservationResponse xmlns:sos="" xmlns:xsi="" xsi:schemaLocation=""> <sos:AssignedObservationId>obs_003223</sos:AssignedObservationId> </sos:InsertObservationResponse>

<<Prev T.O.C Next>>


Files (0)

You must login to post a comment.