SOS Request Template Layouts - CowanSM/owslib GitHub Wiki

Insert Observation

<InsertObservation -namespaces->
  <AssignedSensorId>urn-of-sendor</AssignedSensorId>
  ...
</InsertObservation>

The above two are required in all requests. After that there can be either <om:Measurement> or <om:Observation>. I will detail the two below (there is some difference between what information is in them). The following elements are shared:

    <om:samplingTime /> (this element differs between the two reporting methods)

    <om:procedure xlink:href="sensor-urn" />

    <om:observedProperty /> (this element differs between the two reporting methods)

    <om:featureOfInterest>
      <sa:SamplingPoint gml:id="id">
        <gml:name>foi-name</gml:name>
        <sa:sampledFeature xlink:href=""/>
        <sa:position>
          <gml:Point> (probably any geometry works here, but point seems to be most common)
            <gml:pos srsName="urn-of-coordinates">coords</gml:pos>
          </gml:Point>
        </sa:position>
      </sa:SamplingPoint>
    </om:featureOfInterest>

    <om:result /> (this element differs between the two reporting methods)

The following is elements that <om:Measurement> uses that are different from how <om:Observation> may handle them:

    <om:samplingTime>
      <gml:TimeInstant>
        <gml:timePosition>Z-time-stamp</gml:timePosition>
      </gml:TimeInstant>
    </om:samplingTime>

    <om:observedProperty xlink:href="phenomenon-urn" />

    <om:result uom="measurement-units">measurement-value</om:result>

The following is elements that <om:Observation> uses that are different from <om:Measurement>:

    <om:samplingTime>
      <gml:TimePeriod xsi:type="type-of-time-period">
        <gml:beginPosition>Z-time-stamp</gml:beginPosition>
        <gml:endPosition>Z-time-stamp</gml:endPosition>
      </gml:TimePeriod>
    </omsamplingTime>

    <om:observedProperty>
      <swe:CompositePhenomenon gml:id="id" dimension="dimension-count">
        <gml:name>composite-name</gml:name>
        <swe:component xlink:href="phenomenon-urn" />
        ...
      </swe:CompositePhenomenon>
    </om:observedProperty>

    <om:result>
      <swe:DataArray>
        <swe:elementCount>
          <swe:Count>
            <swe:value>number-of-observations-being-inserted</swe:value>
          </swe:Count>
        </swe:elementCount>
        <swe:elementType name="Components">
          <swe:DataRecord>
            <swe:field name="component-name">
              <swe:time definition="time-def" /> or
              <swe:Text definition="http-resource-urn" /> or
              <swe:Quantity definition="phenomenon-urn">
                <swe:uom code="measurement-units" />
              <swe:Quantity>
            </swe:field>
            ...
          </swe:DataRecord>
        </swe:elementType>
        <swe:encoding>
          <swe:TextBlock decimalSeparator="." tokenSeparator="," blockSeparator=";" />
        <swe:encoding>
        <swe:values>
          values-being-inserted-using-the-above-separators-and-having-a-count-totaling-the-element-count
        </swe:values>
      </sweDataArray>
    </om:result>

Register Sensor

Register Sensor request looks like the following:

<RegisterSensor -namespaces->
  <SensorDescription>
    <sml:SensorML version="1.0.1">
      <sml:member>
        <sml:System xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
          <!--sml:identification element must contain the ID of the sensor-->
          <sml:identification>
	    <sml:IdentifierList>
	      <sml:identifier>
	        <sml:Term definition="urn:ogc:def:identifier:OGC:uniqueID">
	          <sml:value>sensor-urn</sml:value>
	        </sml:Term>
	      </sml:identifier>
	    </sml:IdentifierList>
	  </sml:identification>
	  <!-- last measured position of 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>degrees-east</swe:value>
	            </swe:Quantity>
	          </swe:coordinate>
	          <swe:coordinate name="northing">
	            <swe:Quantity>
		      <swe:uom code="degree" />
  		      <swe:value>degrees-north</swe:value>
		    </swe:Quantity>
	          </swe:coordinate>
	          <swe:coordinate name="altitude">
	            <swe:Quantity>
		      <swe:uom code="altitude-units" />
		      <swe:value>altitude</swe:value>
		    </swe:Quantity>
	          </swe:coordinate>
	        </swe:Vector>
	      </swe:location>
	    </swe:Position>
          </sml:position>
          <!-- list containing the input phenomena for this sensor system -->
	  <sml:inputs>
	    <sml:InputList>
	      <sml:input name="phenomenon-name">
	        <swe:ObservableProperty definition="phenomenon-urn" />
                ...
	      </sml:input>
	    </sml:InputList>
	  </sml:inputs>
	  <!-- list containing the output phenomena of this sensor system;
          ATTENTION: these phenomena are parsed and inserted into the database;
          they have to contain offering elements to determine the correct offering
          for the sensors and measured phenomena -->
	  <sml:outputs>
	    <sml:OutputList>
	      <sml:output name="phenomenon-name">
	        <swe:Position definition="phenomenon-urn">
	          <gml:metaDataProperty>
		    <offering>
		      <id>offering-id</id>
		      <name>offering-long-name</name>
		    </offering>
	          </gml:metaDataProperty>
	        </swe:Position>
	      </sml:output>
              ...
	    </sml:OutputList>
	  </sml:outputs>
	  <!-- description of components of this sensor system; these are currently not used by the 52N SOS -->
	  <sml:components>
	    <sml:ComponentList>
	      <sml:component name="trackingdevice">
	        <sml:Component>
		  <sml:identification>
		    <sml:IdentifierList>
		      <sml:identifier>
		        <sml:Term definition="urn:ogc:def:identifier:OGC:uniqueID">
			  <sml:value>feature-urn</sml:value>
		        </sml:Term>
		      </sml:identifier>
		    </sml:IdentifierList>
		  </sml:identification>
	          <sml:inputs>
		    <sml:InputList>
		      <sml:input name="input-name">
		        <swe:ObservableProperty definition="input-property-urn" />
		      </sml:input>
		    </sml:InputList>
		  </sml:inputs>
		  <sml:outputs>
		    <sml:OutputList>
 		      <sml:output name="output-name">
		        <swe:Position />
		      </sml:output>
		    </sml:OutputList>
		  </sml:outputs>
	        </sml:Component>
	      </sml:component>
              ...
	    </sml:ComponentList>
	  </sml:components>
        </sml:System>
      </sml:member>
    </sml:SensorML>
  </SensorDescription>
  <!-- ObservationTemplate parameter; this has to be an empty measurement at
  the moment, as the 52N SOS only supports Measurements to be inserted -->
  <ObservationTemplate>
    <om:GeometryObservation>
      <om:samplingTime/>
      <om:procedure/>
      <om:observedProperty/>
      <om:featureOfInterest></om:featureOfInterest>
      <om:result></om:result>
    </om:GeometryObservation>
  </ObservationTemplate>
</RegisterSensor>
⚠️ **GitHub.com Fallback** ⚠️